Make WordPress Core


Ignore:
Timestamp:
03/17/2017 04:53:08 PM (7 years ago)
Author:
swissspidy
Message:

List Tables: Hide 'Empty Trash' and 'Empty Spam' buttons when view is already empty.

Props ivantedja, Presskopp, printsachen1, Jaydeep Rami, mathieuhays, cazm.
Fixes #38341.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-comments-list-table.php

    r39669 r40297  
    355355        }
    356356
    357         if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) ) {
     357        if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $this->has_items() ) {
    358358            wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
    359359            $title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
Note: See TracChangeset for help on using the changeset viewer.