Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created June 2, 2017 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchristopher/f0df12b06c5ae3983b1b429c52bbeeb9 to your computer and use it in GitHub Desktop.
Save jchristopher/f0df12b06c5ae3983b1b429c52bbeeb9 to your computer and use it in GitHub Desktop.
Prevent SearchWP from logging searches when the current user is logged in
<?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