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

Props juhise, dipesh.kakadiya, swissspidy.
Fixes #37407.
Built from https://develop.svn.wordpress.org/trunk@38854


git-svn-id: http://core.svn.wordpress.org/trunk@38797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2016-10-21 10:33:54 +00:00
parent 4ba392975a
commit 11a13f147b
2 changed files with 9 additions and 3 deletions

View File

@ -459,6 +459,7 @@ class WP_Posts_List_Table extends WP_List_Table {
<div class="alignleft actions">
<?php
if ( 'top' === $which && !is_singular() ) {
ob_start();
$this->months_dropdown( $this->screen->post_type );
$this->categories_dropdown( $this->screen->post_type );
@ -479,7 +480,12 @@ class WP_Posts_List_Table extends WP_List_Table {
*/
do_action( 'restrict_manage_posts', $this->screen->post_type, $which );
submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
$output = ob_get_clean();
if ( ! empty( $output ) ) {
echo $output;
submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
}
}
if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) ) {
@ -1552,7 +1558,7 @@ class WP_Posts_List_Table extends WP_List_Table {
<?php foreach ( $flat_taxonomies as $taxonomy ) : ?>
<?php if ( current_user_can( $taxonomy->cap->assign_terms ) ) :
$taxonomy_name = esc_attr( $taxonomy->name );
?>
<label class="inline-edit-tags">
<span class="title"><?php echo esc_html( $taxonomy->labels->name ) ?></span>

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-alpha-38853';
$wp_version = '4.7-alpha-38854';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.