Ticket #19693: 19693.diff
File 19693.diff, 1000 bytes (added by , 13 years ago) |
---|
-
canonical.php
476 476 if ( get_query_var('name') ) { 477 477 $where = $wpdb->prepare("post_name LIKE %s", like_escape( get_query_var('name') ) . '%'); 478 478 479 // if any of post_type, year, monthnum, or day are set, use them to refine the query479 // Use either an explicitly set post_type or search IN all registered and publicly queryable post types 480 480 if ( get_query_var('post_type') ) 481 481 $where .= $wpdb->prepare(" AND post_type = %s", get_query_var('post_type')); 482 else 483 $where .= $wpdb->prepare(" AND post_type IN ('" . implode( "', '", get_post_types( array( 'publicly_queryable' => true ) ) ) . "')" ); 484 485 // if any of year, monthnum, or day are set, use them to refine the query 482 486 if ( get_query_var('year') ) 483 487 $where .= $wpdb->prepare(" AND YEAR(post_date) = %d", get_query_var('year')); 484 488 if ( get_query_var('monthnum') )