mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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:
@@ -33,7 +33,7 @@ $commenter = wp_get_current_commenter();
|
||||
extract($commenter);
|
||||
$comments = get_approved_comments($id);
|
||||
$commentstatus = get_post($id);
|
||||
if (!empty($commentstatus->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $commentstatus->post_password) { // and it doesn't match the cookie
|
||||
if ( post_password_required($commentstatus) ) { // and it doesn't match the cookie
|
||||
echo(get_the_password_form());
|
||||
} else { ?>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php if ( !empty($post->post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?>
|
||||
<?php if ( post_password_required() ) : ?>
|
||||
<p><?php _e('Enter your password to view comments.'); ?></p>
|
||||
<?php return; endif; ?>
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ $commenter = wp_get_current_commenter();
|
||||
extract($commenter);
|
||||
$comments = get_approved_comments($id);
|
||||
$post = get_post($id);
|
||||
if (!empty($post->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
|
||||
if ( post_password_required($post) ) { // and it doesn't match the cookie
|
||||
echo(get_the_password_form());
|
||||
} else { ?>
|
||||
|
||||
|
||||
@@ -2,15 +2,10 @@
|
||||
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
|
||||
die ('Please do not load this page directly. Thanks!');
|
||||
|
||||
if (!empty($post->post_password)) { // if there's a password
|
||||
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
|
||||
?>
|
||||
|
||||
<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
|
||||
|
||||
<?php
|
||||
return;
|
||||
}
|
||||
if ( post_password_required() ) { ?>
|
||||
<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
|
||||
<?php
|
||||
return;
|
||||
}
|
||||
|
||||
/* This variable is for alternating comment background */
|
||||
|
||||
Reference in New Issue
Block a user