Make WordPress Core

Ticket #38341: 38341.patch

File 38341.patch, 2.2 KB (added by Jaydeep Rami, 7 years ago)

Attached patch from root

  • src/wp-admin/includes/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 );
  • src/wp-admin/includes/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>
  • src/wp-admin/includes/class-wp-posts-list-table.php

     
    489489                        }
    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                }
    495495?>