Use post_password_required(). see #9015
git-svn-id: http://svn.automattic.com/wordpress/trunk@13027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a8e393c607
commit
1e4d04ee6b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue