fix: address CHRNX editorial review findings

This commit is contained in:
chrnx committed 2026-08-11 18:18:05 -05:00
1 parent 247f9a7915
commit 7297523e26
17 files changed
+236 -10

No files matched your search

+31
View File
@@ -332,6 +332,23 @@ function chrnx_get_journal_base_url() {
return add_query_arg( $routing_values, $base_url );
}
/**
* Return the canonical full Journal destination independent of current filters.
*
* @return string Portable Journal URL.
*/
function chrnx_get_full_journal_url() {
$page = get_page_by_path( 'journal', OBJECT, 'page' );
if ( $page instanceof WP_Post && 'publish' === $page->post_status ) {
$url = get_permalink( $page );
if ( is_string( $url ) && '' !== $url ) {
return $url;
}
}
return home_url( '/journal/' );
}
/**
* Build a Journal page URL from only validated public filters.
*
@@ -543,3 +560,17 @@ function chrnx_get_topic_art_asset( string $topic_slug ): string {
);
return isset( $mapping[ $topic_slug ] ) ? 'assets/images/' . $mapping[ $topic_slug ] : '';
}
/**
* Return exact intrinsic dimensions for allowlisted topic art.
*
* @param string $topic_slug Supported topic slug.
* @return int[] Width and height, or an empty array.
*/
function chrnx_get_topic_art_dimensions( string $topic_slug ): array {
if ( '' === chrnx_get_topic_art_asset( $topic_slug ) ) {
return array();
}
return 'gaming' === $topic_slug ? array( 1024, 1536 ) : array( 1122, 1402 );
}