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@25779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-10-22 17:21:09 +00:00
parent a160441c81
commit 6d97f53134
1 changed files with 11 additions and 9 deletions

View File

@ -1958,15 +1958,7 @@ class WP_Query {
$search .= " AND ($wpdb->posts.post_password = '') "; $search .= " AND ($wpdb->posts.post_password = '') ";
} }
/** return $search;
* 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 ) );
} }
/** /**
@ -2428,6 +2420,16 @@ class WP_Query {
if ( ! empty( $q['s'] ) ) if ( ! empty( $q['s'] ) )
$search = $this->parse_search( $q ); $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 // Taxonomies
if ( !$this->is_singular ) { if ( !$this->is_singular ) {
$this->parse_tax_query( $q ); $this->parse_tax_query( $q );