WordPress.org

Make WordPress Core

Ticket #40975: 40975.patch

File 40975.patch, 1.1 KB (added by SergeyBiryukov, 3 years ago)
  • src/wp-admin/includes/class-wp-comments-list-table.php

     
    319319         */
    320320        protected function extra_tablenav( $which ) {
    321321                global $comment_status, $comment_type;
     322                static $has_items;
     323
     324                if ( ! isset( $has_items ) ) {
     325                        $has_items = $this->has_items();
     326                }
    322327?>
    323328                <div class="alignleft actions">
    324329<?php
     
    354359                        submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
    355360                }
    356361
    357                 if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $this->has_items() ) {
     362                if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $has_items ) {
    358363                        wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
    359364                        $title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
    360365                        submit_button( $title, 'apply', 'delete_all', false );