WordPress.org

Make WordPress Core

Changeset 11745


Ignore:
Timestamp:
07/26/2009 05:16:53 PM (9 years ago)
Author:
ryan
Message:

Canonical redirects for post name queries. Props DD32. see #6516

File:
1 edited

Legend:

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

    r10505 r11745  
    9292                $redirect['query'] = remove_query_arg( 'page', $redirect['query'] );
    9393            }
     94        } elseif ( is_single() && !empty($_GET['name'])  && ! $redirect_url ) {
     95            if ( $redirect_url = get_permalink( $wp_query->get_queried_object_id() ) )
     96                $redirect['query'] = remove_query_arg('name', $redirect['query']);
    9497        } elseif ( is_page() && !empty($_GET['page_id']) && ! $redirect_url ) {
    9598            if ( $redirect_url = get_permalink(get_query_var('page_id')) )
Note: See TracChangeset for help on using the changeset viewer.