Make WordPress Core


Ignore:
Timestamp:
08/04/2020 03:55:25 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Comments: Use the existing static variable instead of calling ::has_items() again in WP_Comments_List_Table::extra_tablenav().

Additionally, removed unnecessary esc_html() on the Filter button label. Core translations are considered safe, and this label is not escaped in any other instance.

Props whyisjake, SergeyBiryukov.
Fixes #40188.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-comments-list-table.php

    r48693 r48722  
    398398
    399399            $this->comment_status_dropdown( $comment_type );
     400
    400401            /**
    401402             * Fires just before the Filter submit button for comment types.
     
    407408            $output = ob_get_clean();
    408409
    409             if ( ! empty( $output ) && $this->has_items() ) {
     410            if ( ! empty( $output ) && $has_items ) {
    410411                echo $output;
    411                 submit_button( esc_html__( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
     412                submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
    412413            }
    413414        }
Note: See TracChangeset for help on using the changeset viewer.