Ticket #37407: 37407.5.diff
File 37407.5.diff, 2.1 KB (added by , 8 years ago) |
---|
-
src/wp-admin/includes/class-wp-posts-list-table.php
459 459 <div class="alignleft actions"> 460 460 <?php 461 461 if ( 'top' === $which && !is_singular() ) { 462 ob_start(); 462 463 463 464 $this->months_dropdown( $this->screen->post_type ); 464 465 $this->categories_dropdown( $this->screen->post_type ); … … 479 480 */ 480 481 do_action( 'restrict_manage_posts', $this->screen->post_type, $which ); 481 482 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 } 483 489 } 484 490 485 491 if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) ) { … … 1552 1558 <?php foreach ( $flat_taxonomies as $taxonomy ) : ?> 1553 1559 <?php if ( current_user_can( $taxonomy->cap->assign_terms ) ) : 1554 1560 $taxonomy_name = esc_attr( $taxonomy->name ); 1555 1561 1556 1562 ?> 1557 1563 <label class="inline-edit-tags"> 1558 1564 <span class="title"><?php echo esc_html( $taxonomy->labels->name ) ?></span> -
tests/phpunit/tests/admin/includesListTable.php
191 191 } 192 192 } 193 193 194 function test_list_filter_button( ) { 195 global $wp_query; 196 197 $cpt_table = _get_list_table( 'WP_Posts_List_Table', array( 'screen' => 'page' ) ); 198 $args = array( 199 'post_type' => 'page', 200 'orderby' => 'title', 201 'order' => 'asc', 202 'posts_per_page' => '-1', 203 ); 204 $wp_query = new WP_Query( $args ); 205 206 ob_start(); 207 $cpt_table->prepare_items(); 208 $cpt_table->extra_tablenav('top'); 209 $output = ob_get_clean(); 210 211 $this->assertNotContains( '<div class="tablenav', $output ); 212 213 } 214 194 215 }