From 9e5beefd7218c53d6f70531904ad869dbc0b2519 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 28 Sep 2014 06:37:10 +0000 Subject: [PATCH] Don't display an empty comment author IP link on Comments screen. props afercia. fixes #29766. git-svn-id: https://develop.svn.wordpress.org/trunk@29774 602fd350-edb4-49c9-b593-d223f7449a82 --- .../includes/class-wp-comments-list-table.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php index 5803b1dca0..e68f0b02d3 100644 --- a/src/wp-admin/includes/class-wp-comments-list-table.php +++ b/src/wp-admin/includes/class-wp-comments-list-table.php @@ -525,14 +525,15 @@ class WP_Comments_List_Table extends WP_List_Table { comment_author_email_link(); echo '
'; } - echo ''; - comment_author_IP(); - echo ''; + + $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( '%s', esc_url( $author_ip_url ), $author_ip ); + } } }