Created
June 12, 2018 12:29
-
-
Save braddalton/4480493b3d391c50416e6035702cc5eb to your computer and use it in GitHub Desktop.
Show Password Protected Content To Logged In WordPress Users https://wp.me/p1lTu0-hzg
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
add_filter( 'post_password_required', 'logged_in_show_password_protected', 10, 2 ); | |
function logged_in_show_password_protected( $returned, $post ) { | |
if ( $returned && is_user_logged_in() ) | |
$returned = false; | |
return $returned; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment