Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created March 9, 2018 14:29
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/f70db768d7f999bb7e25a55579bcec78 to your computer and use it in GitHub Desktop.
Save jchristopher/f70db768d7f999bb7e25a55579bcec78 to your computer and use it in GitHub Desktop.
Prevent SearchWP from excluding anything when logged in
<?php
// Do not exclude anything if user is logged in
add_filter( 'searchwp_exclude', function( $excluded_ids, $engine, $terms ) {
return is_user_logged_in() ? array() : $excluded_ids;
}, 99, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment