Always apply the posts_search filter. Restores 3.6 behavior.
props SergeyBiryukov. fixes #25664. Built from https://develop.svn.wordpress.org/trunk@25867 git-svn-id: http://core.svn.wordpress.org/trunk@25867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4b559801ae
commit
93e54b6646
|
@ -1958,15 +1958,7 @@ class WP_Query {
|
|||
$search .= " AND ($wpdb->posts.post_password = '') ";
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the search SQL that is used in the WHERE clause of WP_Query.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param string $search Search SQL for WHERE clause.
|
||||
* @param WP_Query $this The current WP_Query object.
|
||||
*/
|
||||
return apply_filters_ref_array( 'posts_search', array( $search, &$this ) );
|
||||
return $search;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2428,6 +2420,16 @@ class WP_Query {
|
|||
if ( ! empty( $q['s'] ) )
|
||||
$search = $this->parse_search( $q );
|
||||
|
||||
/**
|
||||
* Filter the search SQL that is used in the WHERE clause of WP_Query.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param string $search Search SQL for WHERE clause.
|
||||
* @param WP_Query $this The current WP_Query object.
|
||||
*/
|
||||
$search = apply_filters_ref_array( 'posts_search', array( $search, &$this ) );
|
||||
|
||||
// Taxonomies
|
||||
if ( !$this->is_singular ) {
|
||||
$this->parse_tax_query( $q );
|
||||
|
|
Loading…
Reference in New Issue