Make WordPress Core

Changeset 25562


Ignore:
Timestamp:
09/22/2013 10:15:38 AM (13 years ago)
Author:
ocean90
Message:

Replace !$user_ID with !is_user_logged_in(). props garyc40. see #15508.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r25555 r25562  
    138138/**
    139139 * Retrieve the HTML link to the URL of the author of the current comment.
    140  * 
     140 *
    141141 * Both get_comment_author_url() and get_comment_author() rely on get_comment(),
    142142 * which falls back to the global comment variable if the $comment_ID argument is empty.
    … …  
    10691069 */
    10701070function get_comment_reply_link($args = array(), $comment = null, $post = null) {
    1071         global $user_ID;
    10721071
    10731072        $defaults = array(
    … …  
    10981097        $link = '';
    10991098
    1100         if ( get_option('comment_registration') && !$user_ID )
     1099        if ( get_option('comment_registration') && ! is_user_logged_in() )
    11011100                $link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_permalink() ) ) . '">' . $login_text . '</a>';
    11021101        else
    … …  
    11521151 */
    11531152function get_post_reply_link($args = array(), $post = null) {
    1154         global $user_ID;
    1155 
    1156         $defaults = array('add_below' => 'post', 'respond_id' => 'respond', 'reply_text' => __('Leave a Comment'),
    1157                 'login_text' => __('Log in to leave a Comment'), 'before' => '', 'after' => '');
     1153        $defaults = array(
     1154                'add_below'  => 'post',
     1155                'respond_id' => 'respond',
     1156                'reply_text' => __('Leave a Comment'),
     1157                'login_text' => __('Log in to leave a Comment'),
     1158                'before'     => '',
     1159                'after'      => '',
     1160        );
    11581161
    11591162        $args = wp_parse_args($args, $defaults);
    … …  
    11641167                return false;
    11651168
    1166         if ( get_option('comment_registration') && !$user_ID ) {
     1169        if ( get_option('comment_registration') && ! is_user_logged_in() ) {
    11671170                $link = '<a rel="nofollow" href="' . wp_login_url( get_permalink() ) . '">' . $login_text . '</a>';
    11681171        } else {
    … …  
    11741177/**
    11751178 * Displays the HTML content for reply to post link.
    1176  * 
     1179 *
    11771180 * @since 2.7.0
    11781181 *
Note: See TracChangeset for help on using the changeset viewer.