Last active
February 18, 2018 19:02
-
-
Save wpchannel/eae87447e3f8092da6f40fa133394d8f to your computer and use it in GitHub Desktop.
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
function wpc_exclude_protected_posts($query) { | |
if (! is_admin() && $query->is_main_query()) { | |
$query->set('has_password', false); | |
} | |
} | |
add_action('pre_get_posts', 'wpc_exclude_protected_posts'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment