WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/17/2017 04:53:08 PM (5 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-media-list-table.php

    r39917 r40297  
    178178        }
    179179
    180         if ( $this->is_trash && current_user_can( 'edit_others_posts' ) ) {
     180        if ( $this->is_trash && current_user_can( 'edit_others_posts' ) && $this->has_items() ) {
    181181            submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );
    182182        } ?>
Note: See TracChangeset for help on using the changeset viewer.