WordPress.org

Make WordPress Core

Ticket #9626: use_is_user_logged_in-have_comments.diff

File use_is_user_logged_in-have_comments.diff, 3.1 KB (added by zeo, 5 years ago)
  • wp-content/themes/classic/comments.php

     
    1414<?php endif; ?> 
    1515</h2> 
    1616 
    17 <?php if ( $comments ) : ?> 
     17<?php if ( have_comments() ) : ?> 
    1818<ol id="commentlist"> 
    1919 
    2020<?php foreach ($comments as $comment) : ?> 
     
    4141<?php if ( comments_open() ) : ?> 
    4242<h2 id="postcomment"><?php _e('Leave a comment'); ?></h2> 
    4343 
    44 <?php if ( get_option('comment_registration') && !$user_ID ) : ?> 
     44<?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?> 
    4545<p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.'), wp_login_url( get_permalink() ) );?></p> 
    4646<?php else : ?> 
    4747 
    4848<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> 
    4949 
    50 <?php if ( $user_ID ) : ?> 
     50<?php if ( is_user_logged_in() ) : ?> 
    5151 
    5252<p><?php printf(__('Logged in as %s.'), '<a href="'.get_option('siteurl').'/wp-admin/profile.php">'.$user_identity.'</a>'); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php _e('Log out of this account') ?>"><?php _e('Log out &raquo;'); ?></a></p> 
    5353 
  • wp-content/themes/classic/comments-popup.php

     
    6363<p><?php _e("Line and paragraph breaks automatic, e-mail address never displayed, <acronym title=\"Hypertext Markup Language\">HTML</acronym> allowed:"); ?> <code><?php echo allowed_tags(); ?></code></p> 
    6464 
    6565<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> 
    66 <?php if ( $user_ID ) : ?> 
     66<?php if ( is_user_logged_in() ) : ?> 
    6767<p><?php printf(__('Logged in as %s.'), '<a href="'.get_option('siteurl').'/wp-admin/profile.php">'.$user_identity.'</a>'); ?> <a href="<?php echo wp_logout_url(); ?>" title="<?php echo attribute_escape(__('Log out of this account')); ?>"><?php _e('Log out &raquo;'); ?></a></p> 
    6868<?php else : ?> 
    6969        <p> 
  • wp-content/themes/default/comments.php

     
    5656        <small><?php cancel_comment_reply_link(); ?></small> 
    5757</div> 
    5858 
    59 <?php if ( get_option('comment_registration') && !$user_ID ) : ?> 
     59<?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?> 
    6060<p>You must be <a href="<?php echo wp_login_url( get_permalink() ); ?>">logged in</a> to post a comment.</p> 
    6161<?php else : ?> 
    6262 
    6363<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> 
    6464 
    65 <?php if ( $user_ID ) : ?> 
     65<?php if ( is_user_logged_in() ) : ?> 
    6666 
    6767<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out &raquo;</a></p> 
    6868