From 543ac83971b93278af0ed70f0da04ef8c10e0050 Mon Sep 17 00:00:00 2001 From: hellofromTonya Date: Mon, 30 Sep 2024 18:18:16 +0000 Subject: [PATCH] Canonical: Revert redirect when front page's paginated states not found. r59091 introduced a backward compatibility (BC) break for a static homepage that includes a shortcode's or block's with paginated content that uses the `'paged'` query var, e.g. bbPress. In this use case, attempting to navigate the shortcode / block's pagination causes a canonical redirect, rather than navigating to the next page of content within that shortcode or block. Follow-up to [59091]. Props davidbinda, jjj. See #50163, #meta5184. Built from https://develop.svn.wordpress.org/trunk@59133 git-svn-id: http://core.svn.wordpress.org/trunk@58529 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp.php | 9 ++++----- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/wp-includes/class-wp.php b/wp-includes/class-wp.php index 11a0b9e6f8..ce88c102cf 100644 --- a/wp-includes/class-wp.php +++ b/wp-includes/class-wp.php @@ -747,15 +747,14 @@ class WP { $content_found = true; if ( is_singular() ) { - $post = isset( $wp_query->post ) ? $wp_query->post : null; - $next = ''; - $page_qv = is_front_page() ? 'paged' : 'page'; + $post = isset( $wp_query->post ) ? $wp_query->post : null; + $next = ''; // Check for paged content that exceeds the max number of pages. - if ( $post && ! empty( $this->query_vars[ $page_qv ] ) ) { + if ( $post && ! empty( $this->query_vars['page'] ) ) { // Check if content is actually intended to be paged. if ( str_contains( $post->post_content, $next ) ) { - $page = trim( $this->query_vars[ $page_qv ], '/' ); + $page = trim( $this->query_vars['page'], '/' ); $content_found = (int) $page <= ( substr_count( $post->post_content, $next ) + 1 ); } else { $content_found = false; diff --git a/wp-includes/version.php b/wp-includes/version.php index 0daba56923..76a3311a3b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-59132'; +$wp_version = '6.7-alpha-59133'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.