Use post_password_required(). see #9015

git-svn-id: https://develop.svn.wordpress.org/trunk@13027 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-02-08 18:24:01 +00:00
parent fc60118ff7
commit e12533e0cb
1 changed files with 1 additions and 3 deletions

View File

@ -4,15 +4,13 @@
$req = get_option('require_name_email'); // Checks if fields are required.
if ( 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']) )
die ( 'Please do not load this page directly. Thanks!' );
if ( ! empty($post->post_password) ) :
if ( $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password ) :
if ( post_password_required() ) :
?>
<div class="nopassword"><?php _e('This post is password protected. Enter the password to view any comments.', 'twentyten') ?></div>
</div><!-- .comments -->
<?php
return;
endif;
endif;
?>
<?php