Available since: 2.5
searchwp_init
By default SearchWP will initialize itself on every page request. If you would like to prevent that from happening, add something like the following to your theme’s functions.php:
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 | |
// prevent SearchWP from initializing itself unless it's a search page | |
function my_searchwp_init() { | |
return is_search(); | |
} | |
add_filter( 'searchwp_init', 'my_searchwp_init' ); |
Note: SearchWP will always initialize itself when is_admin() is true.