Ticket #19693: 19693.2.diff
File 19693.2.diff, 2.1 KB (added by , 12 years ago) |
---|
-
wp-includes/canonical.php
100 100 } 101 101 102 102 if ( ! $redirect_url ) { 103 if ( $redirect_url = redirect_guess_404_permalink($requested_url ) ) {103 if ( $redirect_url = apply_filters( 'redirect_guess_404_permalink', $requested_url ) ) { 104 104 $redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'page', 'feed', 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ), $redirect_url ); 105 105 } 106 106 } … … 489 489 if ( get_query_var('name') ) { 490 490 $where = $wpdb->prepare("post_name LIKE %s", like_escape( get_query_var('name') ) . '%'); 491 491 492 // if any of post_type, year, monthnum, or day are set, use them to refine the query492 // Use either an explicitly set post_type or search in all registered public post types 493 493 if ( get_query_var('post_type') ) 494 $where .= $wpdb->prepare(" AND post_type = %s", get_query_var('post_type')); 494 $where .= $wpdb->prepare( " AND post_type = %s", get_query_var('post_type') ); 495 else 496 $where .= $wpdb->prepare( " AND post_type IN ('" . implode( "', '", get_post_types( array( 'public' => true ) ) ) . "')" ); 497 // If any of year, monthnum, or day are set, use them to refine the query 495 498 if ( get_query_var('year') ) 496 499 $where .= $wpdb->prepare(" AND YEAR(post_date) = %d", get_query_var('year')); 497 500 if ( get_query_var('monthnum') ) -
wp-includes/default-filters.php
191 191 add_filter( 'pings_open', '_close_comments_for_old_post', 10, 2 ); 192 192 add_filter( 'editable_slug', 'urldecode' ); 193 193 add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object' ); 194 add_filter( 'redirect_guess_404_permalink', 'redirect_guess_404_permalink' ); 194 195 195 196 // Actions 196 197 add_action( 'wp_head', 'wp_enqueue_scripts', 1 );