Make WordPress Core

Ticket #35594: 35594.patch

File 35594.patch, 1.2 KB (added by 5um17, 9 years ago)

Patch with conditional posts_search filter

  • wp-includes/query.php

     
    27872787                        $search = $this->parse_search( $q );
    27882788                }
    27892789
    2790                 /**
    2791                  * Filter the search SQL that is used in the WHERE clause of WP_Query.
    2792                  *
    2793                  * @since 3.0.0
    2794                  *
    2795                  * @param string   $search Search SQL for WHERE clause.
    2796                  * @param WP_Query $this   The current WP_Query object.
    2797                  */
    2798                 $search = apply_filters_ref_array( 'posts_search', array( $search, &$this ) );
     2790                if ( !$q['suppress_filters'] ) {
     2791                        /**
     2792                         * Filter the search SQL that is used in the WHERE clause of WP_Query.
     2793                         *
     2794                         * @since 3.0.0
     2795                         *
     2796                         * @param string   $search Search SQL for WHERE clause.
     2797                         * @param WP_Query $this   The current WP_Query object.
     2798                         */
     2799                        $search = apply_filters_ref_array( 'posts_search', array( $search, &$this ) );
     2800                }
    27992801
    28002802                // Taxonomies
    28012803                if ( !$this->is_singular ) {