Skip to content

Commit a2cd165

Browse files
committed
Replace !$user_ID with !is_user_logged_in(). props garyc40. see #15508.
git-svn-id: https://develop.svn.wordpress.org/trunk@25562 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 222c2de commit a2cd165

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

src/wp-includes/comment-template.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function get_comment_author_email_link($linktext='', $before='', $after='') {
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
*
@@ -1068,7 +1068,6 @@ function comments_popup_link( $zero = false, $one = false, $more = false, $css_c
10681068
* @return string|bool|null Link to show comment form, if successful. False, if comments are closed.
10691069
*/
10701070
function get_comment_reply_link($args = array(), $comment = null, $post = null) {
1071-
global $user_ID;
10721071

10731072
$defaults = array(
10741073
'add_below' => 'comment',
@@ -1097,7 +1096,7 @@ function get_comment_reply_link($args = array(), $comment = null, $post = null)
10971096

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
11031102
$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>";
@@ -1151,10 +1150,14 @@ function comment_reply_link($args = array(), $comment = null, $post = null) {
11511150
* @return string|bool|null Link to show comment form, if successful. False, if comments are closed.
11521151
*/
11531152
function 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);
11601163
extract($args, EXTR_SKIP);
@@ -1163,7 +1166,7 @@ function get_post_reply_link($args = array(), $post = null) {
11631166
if ( !comments_open($post->ID) )
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 {
11691172
$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>";
@@ -1173,7 +1176,7 @@ function get_post_reply_link($args = array(), $post = null) {
11731176

11741177
/**
11751178
* Displays the HTML content for reply to post link.
1176-
*
1179+
*
11771180
* @since 2.7.0
11781181
*
11791182
* @param array $args Optional. Override default options, @see get_post_reply_link().

0 commit comments

Comments
 (0)