From b033c7c6fa4e42b174e981998aa19be311161a0c Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Sat, 7 Apr 2012 05:18:50 +0000 Subject: [PATCH] Properly handle paged permalink URLs even when we are not already 301ing. fixes #20385 git-svn-id: https://develop.svn.wordpress.org/trunk@20397 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/canonical.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index ce5c8bfeb7..e0881ad09c 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -209,7 +209,9 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) { } // Post Paging - if ( is_singular() && get_query_var('page') && $redirect_url ) { + if ( is_singular() && get_query_var('page') ) { + if ( !$redirect_url ) + $redirect_url = get_permalink( get_queried_object_id() ); $redirect_url = trailingslashit( $redirect_url ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' ); $redirect['query'] = remove_query_arg( 'page', $redirect['query'] ); }