Ticket #15508: 15508.patch
File 15508.patch, 2.8 KB (added by , 12 years ago) |
---|
-
src/wp-includes/comment-template.php
137 137 138 138 /** 139 139 * Retrieve the HTML link to the URL of the author of the current comment. 140 * 140 * 141 141 * Both get_comment_author_url() and get_comment_author() rely on get_comment(), 142 142 * which falls back to the global comment variable if the $comment_ID argument is empty. 143 143 * … … 1044 1044 * @return string|bool|null Link to show comment form, if successful. False, if comments are closed. 1045 1045 */ 1046 1046 function get_comment_reply_link($args = array(), $comment = null, $post = null) { 1047 global $user_ID;1048 1047 1049 1048 $defaults = array( 1050 1049 'add_below' => 'comment', … … 1073 1072 1074 1073 $link = ''; 1075 1074 1076 if ( get_option('comment_registration') && ! $user_ID)1075 if ( get_option('comment_registration') && ! is_user_logged_in() ) 1077 1076 $link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_permalink() ) ) . '">' . $login_text . '</a>'; 1078 1077 else 1079 1078 $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>"; … … 1127 1126 * @return string|bool|null Link to show comment form, if successful. False, if comments are closed. 1128 1127 */ 1129 1128 function 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 ); 1131 1137 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 1135 1138 $args = wp_parse_args($args, $defaults); 1136 1139 extract($args, EXTR_SKIP); 1137 1140 $post = get_post($post); … … 1139 1142 if ( !comments_open($post->ID) ) 1140 1143 return false; 1141 1144 1142 if ( get_option('comment_registration') && ! $user_ID) {1145 if ( get_option('comment_registration') && ! is_user_logged_in() ) { 1143 1146 $link = '<a rel="nofollow" href="' . wp_login_url( get_permalink() ) . '">' . $login_text . '</a>'; 1144 1147 } else { 1145 1148 $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>"; … … 1149 1152 1150 1153 /** 1151 1154 * Displays the HTML content for reply to post link. 1152 * 1155 * 1153 1156 * @since 2.7.0 1154 1157 * 1155 1158 * @param array $args Optional. Override default options, @see get_post_reply_link().