Created
March 9, 2018 14:29
-
-
Save jchristopher/f70db768d7f999bb7e25a55579bcec78 to your computer and use it in GitHub Desktop.
Prevent SearchWP from excluding anything when 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 | |
// 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