Don't display an empty comment author IP link on Comments screen.

props afercia.
fixes #29766.
Built from https://develop.svn.wordpress.org/trunk@29774


git-svn-id: http://core.svn.wordpress.org/trunk@29546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-09-28 06:38:18 +00:00
parent d7de59cb00
commit ebdfe06843

View File

@ -525,14 +525,15 @@ class WP_Comments_List_Table extends WP_List_Table {
comment_author_email_link();
echo '<br />';
}
echo '<a href="edit-comments.php?s=';
comment_author_IP();
echo '&amp;mode=detail';
if ( 'spam' == $comment_status )
echo '&amp;comment_status=spam';
echo '">';
comment_author_IP();
echo '</a>';
$author_ip = get_comment_author_IP();
if ( $author_ip ) {
$author_ip_url = add_query_arg( array( 's' => $author_ip, 'mode' => 'detail' ), 'edit-comments.php' );
if ( 'spam' == $comment_status ) {
$author_ip_url = add_query_arg( 'comment_status', 'spam', $author_ip_url );
}
printf( '<a href="%s">%s</a>', esc_url( $author_ip_url ), $author_ip );
}
}
}