Make WordPress Core

Ticket #38341: 38341.diff

File 38341.diff, 1.7 KB (added by ivantedja, 8 years ago)
  • wp-admin/includes/class-wp-comments-list-table.php

    diff --git a/wp-admin/includes/class-wp-comments-list-table.php b/wp-admin/includes/class-wp-comments-list-table.php
    index 116a55e..aede18d 100644
    a b class WP_Comments_List_Table extends WP_List_Table { 
    354354                        submit_button( __( 'Filter' ), 'button', '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 );
  • wp-admin/includes/class-wp-posts-list-table.php

    diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php
    index 7ef790e..ae8c130 100644
    a b class WP_Posts_List_Table extends WP_List_Table { 
    482482                        submit_button( __( 'Filter' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
    483483                }
    484484
    485                 if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) ) {
     485                if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) && $this->has_items() ) {
    486486                        submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );
    487487                }
    488488?>