Advertisement
Viper007Bond

Untitled

Jul 15th, 2011
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. // No need to trigger WordPress search since Google Custom Search is being used
  2. function cf_kill_wp_search( $where, $query ) {
  3.     if( ! is_admin() && $query->is_search() )
  4.         $where = ' AND 1=0';
  5.    
  6.     // Only need to do this for the main query
  7.     remove_filter( 'posts_where', 'cf_kill_wp_search', 10 );
  8.    
  9.     return $where;
  10. }
  11.  
  12. add_filter( 'posts_where', 'cf_kill_wp_search, 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement