Assume that I have created plugin to include custom post type called site and plugin to search result. Assume I have added only following code to my plugin.
function searchAll( $query ) {
if ( $query->is_search ) { $query->set( 'post_type', array( 'site', 'plugin' )); }
return $query;
}
add_filter( 'the_search_query', 'searchAll' );
When this function call? Is it call in every page views? Or is it call in only when some one search?