Ticket #17021: find-posts_3.2.patch
| File find-posts_3.2.patch, 951 bytes (added by kevinB, 2 years ago) |
|---|
-
wp-admin/admin-ajax.php
1274 1274 if ( count($search_terms) > 1 && $search_terms[0] != $s ) 1275 1275 $search .= " OR ($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%')"; 1276 1276 1277 $posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND post_status IN ('draft', 'publish') AND ($search) ORDER BY post_date_gmt DESC LIMIT 50");1277 $posts = $wpdb->get_results( apply_filters( 'find_posts_query', "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND post_status IN ('draft', 'publish') AND ($search) ORDER BY post_date_gmt DESC LIMIT 50", $what, $search, $s ) ); 1278 1278 1279 1279 if ( ! $posts ) { 1280 1280 $posttype = get_post_type_object($what);
