Created
January 20, 2016 19:45
-
-
Save anonymous/0f845dd15a7cf93f7ba1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// WordPress Suchfunktion vollständig abschalten | |
function ah_filter_query( $query, $error = true ) { | |
if ( is_search() ) { | |
$query->is_search = false; | |
$query->query_vars[s] = false; | |
$query->query[s] = false; | |
// to error | |
if ( $error == true ) | |
$query->is_404 = true; | |
} | |
} | |
add_action( 'parse_query', 'ah_filter_query' ); | |
add_filter( 'get_search_form', create_function( '$a', "return null;" ) ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment