Ticket #43056: canonical.php.patch
| File canonical.php.patch, 973 bytes (added by , 7 years ago) |
|---|
-
src/wp-includes/canonical.php
664 664 $where = $wpdb->prepare( 'post_name LIKE %s', $wpdb->esc_like( get_query_var( 'name' ) ) . '%' ); 665 665 666 666 // if any of post_type, year, monthnum, or day are set, use them to refine the query 667 if ( get_query_var( 'post_type' ) ) { 668 $where .= $wpdb->prepare( ' AND post_type = %s', get_query_var( 'post_type' ) ); 667 $post_type = get_query_var( 'post_type' ); 668 669 if ( $post_type ) { 670 if ( is_array( $post_type ) ) { 671 $where .= " AND post_type IN ('" . join( "', '", esc_sql( $post_type ) ) . "')"; 672 } else { 673 $where .= $wpdb->prepare( ' AND post_type = %s', get_query_var( 'post_type' ) ); 674 } 669 675 } else { 670 676 $where .= " AND post_type IN ('" . implode( "', '", get_post_types( array( 'public' => true ) ) ) . "')"; 671 677 }