Changeset 53676
- Timestamp:
- 07/06/2022 07:29:29 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/search/class-wp-rest-post-search-handler.php
r53485 r53676 59 59 60 60 $query_args = array( 61 'post_type' 62 'post_status' 63 'paged' 64 'posts_per_page' 65 'ignore_sticky_posts' 61 'post_type' => $post_types, 62 'post_status' => 'publish', 63 'paged' => (int) $request['page'], 64 'posts_per_page' => (int) $request['per_page'], 65 'ignore_sticky_posts' => true, 66 66 ); 67 67 … … 82 82 $query_args = apply_filters( 'rest_post_search_query', $query_args, $request ); 83 83 84 $query 85 $posts 84 $query = new WP_Query(); 85 $posts = $query->query( $query_args ); 86 86 // Querying the whole post object will warm the object cache, avoiding an extra query per result. 87 87 $found_ids = wp_list_pluck( $posts, 'ID' );
Note: See TracChangeset
for help on using the changeset viewer.