Make WordPress Core

Ticket #15508: 15508.patch

File 15508.patch, 2.8 KB (added by ocean90, 12 years ago)
  • src/wp-includes/comment-template.php

     
    137137
    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.
    143143 *
     
    10441044 * @return string|bool|null Link to show comment form, if successful. False, if comments are closed.
    10451045 */
    10461046function get_comment_reply_link($args = array(), $comment = null, $post = null) {
    1047         global $user_ID;
    10481047
    10491048        $defaults = array(
    10501049                'add_below'  => 'comment',
     
    10731072
    10741073        $link = '';
    10751074
    1076         if ( get_option('comment_registration') && !$user_ID )
     1075        if ( get_option('comment_registration') && ! is_user_logged_in() )
    10771076                $link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_permalink() ) ) . '">' . $login_text . '</a>';
    10781077        else
    10791078                $link = "<a class='comment-reply-link' href='" . esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";
     
    11271126 * @return string|bool|null Link to show comment form, if successful. False, if comments are closed.
    11281127 */
    11291128function get_post_reply_link($args = array(), $post = null) {
    1130         global $user_ID;
     1129        $defaults = array(
     1130                'add_below'  => 'post',
     1131                'respond_id' => 'respond',
     1132                'reply_text' => __('Leave a Comment'),
     1133                'login_text' => __('Log in to leave a Comment'),
     1134                'before'     => '',
     1135                'after'      => '',
     1136        );
    11311137
    1132         $defaults = array('add_below' => 'post', 'respond_id' => 'respond', 'reply_text' => __('Leave a Comment'),
    1133                 'login_text' => __('Log in to leave a Comment'), 'before' => '', 'after' => '');
    1134 
    11351138        $args = wp_parse_args($args, $defaults);
    11361139        extract($args, EXTR_SKIP);
    11371140        $post = get_post($post);
     
    11391142        if ( !comments_open($post->ID) )
    11401143                return false;
    11411144
    1142         if ( get_option('comment_registration') && !$user_ID ) {
     1145        if ( get_option('comment_registration') && ! is_user_logged_in() ) {
    11431146                $link = '<a rel="nofollow" href="' . wp_login_url( get_permalink() ) . '">' . $login_text . '</a>';
    11441147        } else {
    11451148                $link = "<a rel='nofollow' class='comment-reply-link' href='" . get_permalink($post->ID) . "#$respond_id' onclick='return addComment.moveForm(\"$add_below-$post->ID\", \"0\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";
     
    11491152
    11501153/**
    11511154 * Displays the HTML content for reply to post link.
    1152  * 
     1155 *
    11531156 * @since 2.7.0
    11541157 *
    11551158 * @param array $args Optional. Override default options, @see get_post_reply_link().