Make WordPress Core


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

    r39956 r40297  
    490490        }
    491491
    492         if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) ) {
     492        if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) && $this->has_items() ) {
    493493            submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );
    494494        }
Note: See TracChangeset for help on using the changeset viewer.