WordPress.org

Make WordPress Core

Changeset 12980


Ignore:
Timestamp:
02/06/10 03:50:55 (4 years ago)
Author:
dd32
Message:

Redirect ?page_id=xx for the Posts page to the posts page. Fixes #11991

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/canonical.php

    r12979 r12980  
    103103        } 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 ) { 
    104104            $redirect_url = home_url('/'); 
     105        } 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 ) { 
     106            if ( $redirect_url = get_permalink(get_option('page_for_posts')) ) 
     107                $redirect['query'] = remove_query_arg('page_id', $redirect['query']); 
    105108        } elseif ( !empty($_GET['m']) && ( is_year() || is_month() || is_day() ) ) { 
    106109            $m = get_query_var('m'); 
Note: See TracChangeset for help on using the changeset viewer.