Make WordPress Core

Changeset 9193


Ignore:
Timestamp:
10/15/2008 10:00:12 PM (16 years ago)
Author:
markjaquith
Message:

Redirect alternate is_single() URLs (like multiple category-based urls) to the canonical URL. fixes #6627

File:
1 edited

Legend:

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

    r9177 r9193  
    8181            if ( $redirect_url = get_permalink(get_query_var('p')) )
    8282                $redirect['query'] = remove_query_arg('p', $redirect['query']);
     83        } elseif ( is_single() && ! $redirect_url ) {
     84            $redirect_url = get_permalink( url_to_postid( $requested_url ) );
    8385        } elseif ( is_page() && isset($_GET['page_id']) && ! $redirect_url ) {
    8486            if ( $redirect_url = get_permalink(get_query_var('page_id')) )
Note: See TracChangeset for help on using the changeset viewer.