]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/class-wp-comments-list-table.php
WordPress 4.1
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-comments-list-table.php
index 5803b1dca0d135296bbef87b5160ebb3e9570495..3814f98bcfbcbba77df4e42764432555f896bea8 100644 (file)
@@ -242,7 +242,8 @@ class WP_Comments_List_Table extends WP_List_Table {
 <?php
                if ( 'top' == $which ) {
 ?>
-                       <select name="comment_type">
+                       <label class="screen-reader-text" for="filter-by-comment-type"><?php _e( 'Filter by comment type' ); ?></label>
+                       <select id="filter-by-comment-type" name="comment_type">
                                <option value=""><?php _e( 'All comment types' ); ?></option>
 <?php
                                /**
@@ -525,14 +526,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 );
+                       }
                }
        }