From 6d97f53134984f9a45625cfc01c9db257918f5dc Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 22 Oct 2013 17:21:09 +0000 Subject: [PATCH] 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 --- wp-includes/query.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index e81951a740..b0fd38d1a1 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -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 );