Created
June 2, 2017 13:03
-
-
Save jchristopher/f0df12b06c5ae3983b1b429c52bbeeb9 to your computer and use it in GitHub Desktop.
Prevent SearchWP from logging searches when the current user is logged in
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 logging searches when logged in | |
function my_searchwp_skip_logged_in_log( $log, $engine, $search_terms, $number_of_results ) { | |
return ! is_user_logged_in(); | |
} | |
add_filter( 'searchwp_log_search', 'my_searchwp_skip_logged_in_log', 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment