Skip to content

Instantly share code, notes, and snippets.

@braddalton
Created June 12, 2018 12: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 braddalton/4480493b3d391c50416e6035702cc5eb to your computer and use it in GitHub Desktop.
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
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