Make WordPress Core


Ignore:
Timestamp:
10/21/2016 10:32:55 AM (9 years ago)
Author:
swissspidy
Message:

List Tables: Do not show filter button when there are no filter options available.

Props juhise, dipesh.kakadiya, swissspidy.
Fixes #37407.

File:
1 edited

Legend:

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

    r38797 r38854  
    460460<?php
    461461        if ( 'top' === $which && !is_singular() ) {
     462            ob_start();
    462463
    463464            $this->months_dropdown( $this->screen->post_type );
     
    480481            do_action( 'restrict_manage_posts', $this->screen->post_type, $which );
    481482
    482             submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
     483            $output = ob_get_clean();
     484
     485            if ( ! empty( $output ) ) {
     486                echo $output;
     487                submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
     488            }
    483489        }
    484490
     
    15531559        <?php if ( current_user_can( $taxonomy->cap->assign_terms ) ) :
    15541560            $taxonomy_name = esc_attr( $taxonomy->name );
    1555    
     1561
    15561562            ?>
    15571563            <label class="inline-edit-tags">
Note: See TracChangeset for help on using the changeset viewer.