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