Changeset 7319 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/search.php
- Timestamp:
- 06/19/2018 09:44:33 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/search.php
r5432 r7319 25 25 add_filter( 'posts_orderby', array( __CLASS__, 'search_posts_orderby' ), 10, 2 ); 26 26 add_filter( 'the_posts', array( __CLASS__, 'rerun_empty_exact_search' ), 10, 2 ); 27 add_filter( 'query_vars', array( __CLASS__, 'default_qv_empty_post_type_search' ) );28 }29 30 /**31 * Add query var to indicate if no post type filters were explicitly used for32 * a search.33 *34 * Defaults the query var 'empty_post_type_search' to false. It is potentially35 * set to true elsewhere.36 *37 * @param array $public_query_vars The array of whitelisted query variables.38 * @return array39 */40 public static function default_qv_empty_post_type_search( $public_query_vars ) {41 $public_query_vars['empty_post_type_search'] = false;42 return $public_query_vars;43 27 } 44 28 … … 60 44 // Separates searches for handbook pages from non-handbook pages depending on 61 45 // whether the search was performed within context of a handbook page or not. 62 if ( get_query_var( 'is_handbook' )) {46 if ( $query->is_handbook ) { 63 47 // Search only in current handbook post type. 64 48 // Just to make sure. post type should already be set. … … 83 67 if ( ! $qv_post_types ) { 84 68 // Record the fact no post types were explicitly supplied. 85 $query-> set( 'empty_post_type_search', true );69 $query->is_empty_post_type_search = true; 86 70 87 71 // Not a handbook page, or exact search, or filters used.
Note: See TracChangeset
for help on using the changeset viewer.