From 76dda2b57051d8007e4b3b6351694b627b57839a Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sat, 6 Feb 2010 03:50:55 +0000 Subject: [PATCH] Redirect ?page_id=xx for the Posts page to the posts page. Fixes #11991 git-svn-id: https://develop.svn.wordpress.org/trunk@12980 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/canonical.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index 8d9b7b6286..5c03bb4a86 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -102,6 +102,9 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { $redirect['query'] = remove_query_arg('page_id', $redirect['query']); } elseif ( is_page() && isset($wp_query->queried_object) && 'page' == get_option('show_on_front') && $wp_query->queried_object->ID == get_option('page_on_front') && ! $redirect_url ) { $redirect_url = home_url('/'); + } elseif ( is_home() && !empty($_GET['page_id']) && 'page' == get_option('show_on_front') && get_query_var('page_id') == get_option('page_for_posts') && ! $redirect_url ) { + if ( $redirect_url = get_permalink(get_option('page_for_posts')) ) + $redirect['query'] = remove_query_arg('page_id', $redirect['query']); } elseif ( !empty($_GET['m']) && ( is_year() || is_month() || is_day() ) ) { $m = get_query_var('m'); switch ( strlen($m) ) {