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:
Andrew Nacin 2013-10-24 22:59:12 +00:00
parent 4b559801ae
commit 93e54b6646
1 changed files with 11 additions and 9 deletions

View File

@ -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 );