Make WordPress Core

Changeset 20688


Ignore:
Timestamp:
05/02/2012 05:39:43 PM (12 years ago)
Author:
nacin
Message:

Only look for public post types in redirect_guess_404_permalink() when no post type query var is present. props jeremyfelt. fixes #19693.

File:
1 edited

Legend:

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

    r20669 r20688  
    493493        if ( get_query_var('post_type') )
    494494            $where .= $wpdb->prepare(" AND post_type = %s", get_query_var('post_type'));
     495        else
     496            $where .= " AND post_type IN ('" . implode( "', '", get_post_types( array( 'public' => true ) ) ) . "')";
     497
    495498        if ( get_query_var('year') )
    496499            $where .= $wpdb->prepare(" AND YEAR(post_date) = %d", get_query_var('year'));
Note: See TracChangeset for help on using the changeset viewer.