post_password_required(). fixes #7679

git-svn-id: https://develop.svn.wordpress.org/trunk@8800 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-09-03 19:54:14 +00:00
parent 341cede30b
commit a487b60f71
7 changed files with 45 additions and 31 deletions

View File

@@ -802,11 +802,9 @@ function comments_popup_link( $zero = 'No Comments', $one = '1 Comment', $more =
return;
}
if ( !empty($post->post_password) ) { // if there's a password
if ( !isset($_COOKIE['wp-postpass_' . COOKIEHASH]) || $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password ) { // and it doesn't match the cookie
echo __('Enter your password to view comments');
return;
}
if ( post_password_required() ) {
echo __('Enter your password to view comments');
return;
}
echo '<a href="';