bp_search_clear_native_search_query( mixed $query )

Force native wp search page not to look any data into db to save query and performance

Description

Parameters

$query

(Required)

Return

(mixed)

Source

File: bp-search/bp-search-filters.php

191
192
193
194
195
196
197
198
199
200
function bp_search_clear_native_search_query( $query ) {
 
    if ( bp_search_is_search() ) {
 
        remove_filter( 'pre_get_posts', 'bp_search_clear_native_search_query' ); //only do first time
 
    }
 
    return $query;
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.