WordPress.org

Make WordPress Core

Changeset 13697


Ignore:
Timestamp:
03/14/10 05:06:47 (8 years ago)
Author:
dd32
Message:

Limit redirect_guess_404_permalink() to the same post_type if it's specified in the query. See #12601

File:
1 edited

Legend:

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

    r13623 r13697  
    363363    $where = $wpdb->prepare("post_name LIKE %s", get_query_var('name') . '%'); 
    364364 
    365     // if any of year, monthnum, or day are set, use them to refine the query 
     365    // if any of post_type, year, monthnum, or day are set, use them to refine the query 
     366    if ( get_query_var('post_type') ) 
     367        $where .= $wpdb->prepare(" AND post_type = %s", get_query_var('post_type')); 
    366368    if ( get_query_var('year') ) 
    367369        $where .= $wpdb->prepare(" AND YEAR(post_date) = %d", get_query_var('year')); 
Note: See TracChangeset for help on using the changeset viewer.