Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // No need to trigger WordPress search since Google Custom Search is being used
- function cf_kill_wp_search( $where, $query ) {
- if( ! is_admin() && $query->is_search() )
- $where = ' AND 1=0';
- // Only need to do this for the main query
- remove_filter( 'posts_where', 'cf_kill_wp_search', 10 );
- return $where;
- }
- add_filter( 'posts_where', 'cf_kill_wp_search, 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement