Make WordPress Core

Ticket #38341: 38341.2.diff

File 38341.2.diff, 2.0 KB (added by Presskopp, 8 years ago)
  • class-wp-comments-list-table.php

     
    354354                        submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
    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' );
    360360                        submit_button( $title, 'apply', 'delete_all', false );
  • class-wp-media-list-table.php

     
    177177                        submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
    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                } ?>
    183183                </div>
  • class-wp-posts-list-table.php

     
    488488                        }
    489489                }
    490490
    491                 if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) ) {
     491                if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) && $this->has_items() ) {
    492492                        submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );
    493493                }
    494494?>