diff --git a/chapters.php b/chapters.php index be9103de..66c0f585 100644 --- a/chapters.php +++ b/chapters.php @@ -15,6 +15,7 @@ $page, - 'post_id' => get_the_ID(), + 'post_id' => $post_id, 'chapters' => $list_of_chapters, 'queried_type' => 'fcn_chapter', 'query_args' => $query_args, @@ -92,7 +93,7 @@ if ( function_exists( 'update_post_author_caches' ) ) { ); ?> -
+
@@ -118,7 +119,7 @@ if ( function_exists( 'update_post_author_caches' ) ) { // Footer arguments $footer_args = array( 'post_type' => 'page', - 'post_id' => get_the_ID(), + 'post_id' => $post_id, 'current_page' => $page, 'chapters' => $list_of_chapters, 'breadcrumbs' => array( diff --git a/collections.php b/collections.php index d92eabc5..98577987 100644 --- a/collections.php +++ b/collections.php @@ -15,6 +15,7 @@ $page, - 'post_id' => get_the_ID(), + 'post_id' => $post_id, 'collections' => $list_of_collections, 'queried_type' => 'fcn_collection', 'query_args' => $query_args, @@ -81,7 +82,7 @@ if ( function_exists( 'update_post_author_caches' ) ) { ); ?> -
+
@@ -107,7 +108,7 @@ if ( function_exists( 'update_post_author_caches' ) ) { // Footer arguments $footer_args = array( 'post_type' => 'page', - 'post_id' => get_the_ID(), + 'post_id' => $post_id, 'current_page' => $page, 'collections' => $list_of_collections, 'breadcrumbs' => array( diff --git a/includes/functions/_query_helpers.php b/includes/functions/_query_helpers.php index 5ee7befa..07da6411 100644 --- a/includes/functions/_query_helpers.php +++ b/includes/functions/_query_helpers.php @@ -24,7 +24,7 @@ function fictioneer_allowed_orderby() { if ( ! function_exists( 'fictioneer_get_card_list' ) ) { /** - * Returns the query and HTML list items for a post type. + * Returns the query and HTML list items for a post type * * @since Fictioneer 5.0 * @@ -131,10 +131,11 @@ if ( ! function_exists( 'fictioneer_get_card_list' ) ) { while ( $query->have_posts() ) { $query->the_post(); + $card_post_id = get_the_ID(); switch ( $post_type ) { case 'fcn_story': - if ( get_post_meta( get_the_ID(), 'fictioneer_story_hidden', true ) ) { + if ( get_post_meta( $card_post_id, 'fictioneer_story_hidden', true ) ) { get_template_part( 'partials/_card-hidden', null, $the_card_args ); } else { get_template_part( $card_partial, null, $the_card_args ); @@ -142,8 +143,8 @@ if ( ! function_exists( 'fictioneer_get_card_list' ) ) { break; case 'fcn_chapter': if ( - get_post_meta( get_the_ID(), 'fictioneer_chapter_hidden', true ) || - get_post_meta( get_the_ID(), 'fictioneer_chapter_no_chapter', true ) + get_post_meta( $card_post_id, 'fictioneer_chapter_hidden', true ) || + get_post_meta( $card_post_id, 'fictioneer_chapter_no_chapter', true ) ) { get_template_part( 'partials/_card-hidden', null, $the_card_args ); } else { diff --git a/includes/functions/_wordpress_mods.php b/includes/functions/_wordpress_mods.php index d820ebb2..841971ce 100644 --- a/includes/functions/_wordpress_mods.php +++ b/includes/functions/_wordpress_mods.php @@ -361,10 +361,10 @@ function fictioneer_output_rss( $post_id = null ) { $title = sprintf( _x( '%1$s - %2$s Chapters', 'Story Feed: [Site] - [Story] Chapters.', 'fictioneer' ), get_bloginfo( 'name' ), - get_the_title( get_the_ID() ) + get_the_title( $post_id ) ); - $url = esc_url( add_query_arg( 'story_id', get_the_ID(), home_url( 'feed/rss-chapters' ) ) ); + $url = esc_url( add_query_arg( 'story_id', $post_id, home_url( 'feed/rss-chapters' ) ) ); $rss_link = ''; } diff --git a/includes/functions/comments/_comments_form.php b/includes/functions/comments/_comments_form.php index 46a744cd..63429ba9 100644 --- a/includes/functions/comments/_comments_form.php +++ b/includes/functions/comments/_comments_form.php @@ -132,6 +132,7 @@ function fictioneer_change_submit_field( $submit_field, $args ) { remove_filter( 'cancel_comment_reply_link', '__return_empty_string' ); // Setup + $post_id = get_the_ID(); $close_bottom_container = is_user_logged_in() ? '' : ''; $is_ajax = get_option( 'fictioneer_enable_ajax_comment_form' ) || get_option( 'fictioneer_enable_ajax_comments' ); $hidden = FICTIONEER_COLLAPSE_COMMENT_FORM ? 'hidden' : ''; @@ -196,7 +197,7 @@ function fictioneer_change_submit_field( $submit_field, $args ) { return sprintf( $close_bottom_container . '
' . $private_toggle . $notification_toggle . '%1$s %2$s
%3$s
' . $private_notice . '
', $submit_button, - get_the_ID() ? get_comment_id_fields( get_the_ID() ) : ( $parent_field . $comment_post_id ), + $post_id ? get_comment_id_fields( $post_id ) : ( $parent_field . $comment_post_id ), preg_replace( '/
diff --git a/partials/_share-buttons.php b/partials/_share-buttons.php index f139260f..97f4399d 100644 --- a/partials/_share-buttons.php +++ b/partials/_share-buttons.php @@ -18,9 +18,10 @@ defined( 'ABSPATH' ) OR exit; // Setup +$post_id = get_the_ID(); $feed = fictioneer_get_rss_link(); $show_feed = get_post_type() !== 'fcn_story' || - ( get_post_type() === 'fcn_story' && get_post_meta( get_the_ID(), 'fictioneer_story_status', true ) !== 'Oneshot' ) + ( get_post_type() === 'fcn_story' && get_post_meta( $post_id, 'fictioneer_story_status', true ) !== 'Oneshot' ); ?> @@ -36,7 +37,7 @@ $show_feed = get_post_type() !== 'fcn_story' || - +
-
+
diff --git a/single-fcn_recommendation.php b/single-fcn_recommendation.php index 99bf1136..a66ace5d 100644 --- a/single-fcn_recommendation.php +++ b/single-fcn_recommendation.php @@ -30,7 +30,7 @@ get_header( null, array( 'type' => 'fcn_recommendation' ) ); ID ); - $this_breadcrumb = [$title, get_the_permalink()]; + $this_breadcrumb = [ $title, get_the_permalink() ]; // Arguments for hooks and templates/etc. $hook_args = array( diff --git a/single-fcn_story.php b/single-fcn_story.php index bec32fb0..1a60d8c1 100644 --- a/single-fcn_story.php +++ b/single-fcn_story.php @@ -41,7 +41,7 @@ get_header( null, $header_args ); $story_id = $post->ID; $story = fictioneer_get_story_data( $post->ID ); $epub_name = sanitize_file_name( strtolower( get_the_title() ) ); - $this_breadcrumb = [$story['title'], get_the_permalink()]; + $this_breadcrumb = [ $story['title'], get_the_permalink() ]; $password_note = fictioneer_get_content_field( 'fictioneer_story_password_note', $post->ID ); // Flags diff --git a/singular-titleless.php b/singular-titleless.php index 0391c496..f622a2a5 100644 --- a/singular-titleless.php +++ b/singular-titleless.php @@ -11,6 +11,9 @@ -
+
@@ -55,7 +58,7 @@ get_header(); // Footer arguments $footer_args = array( 'post_type' => 'page', - 'post_id' => get_the_ID(), + 'post_id' => $post_id, 'breadcrumbs' => array( [fcntr( 'frontpage' ), get_home_url()] ) diff --git a/singular.php b/singular.php index 4d19e476..ed5a691f 100644 --- a/singular.php +++ b/singular.php @@ -11,6 +11,9 @@ -
+

@@ -59,7 +62,7 @@ get_header(); // Footer arguments $footer_args = array( 'post_type' => 'page', - 'post_id' => get_the_ID(), + 'post_id' => $post_id, 'breadcrumbs' => array( [fcntr( 'frontpage' ), get_home_url()] ) diff --git a/stories.php b/stories.php index a5c62aad..ba2be990 100644 --- a/stories.php +++ b/stories.php @@ -16,6 +16,7 @@ -
+
@@ -128,7 +129,7 @@ if ( function_exists( 'update_post_author_caches' ) ) { // Footer arguments $footer_args = array( 'post_type' => 'page', - 'post_id' => $post->ID, + 'post_id' => $post_id, 'current_page' => $page, 'stories' => $list_of_stories, 'breadcrumbs' => array(