diff --git src/wp-admin/includes/class-wp-list-table.php src/wp-admin/includes/class-wp-list-table.php
index bf642ac..9fc20fe 100644
|
|
class WP_List_Table { |
1175 | 1175 | if ( 'top' === $which ) { |
1176 | 1176 | wp_nonce_field( 'bulk-' . $this->_args['plural'] ); |
1177 | 1177 | } |
1178 | | ?> |
1179 | | <div class="tablenav <?php echo esc_attr( $which ); ?>"> |
1180 | 1178 | |
1181 | | <?php if ( $this->has_items() ): ?> |
1182 | | <div class="alignleft actions bulkactions"> |
1183 | | <?php $this->bulk_actions( $which ); ?> |
1184 | | </div> |
1185 | | <?php endif; |
1186 | | $this->extra_tablenav( $which ); |
1187 | | $this->pagination( $which ); |
1188 | | ?> |
1189 | | |
1190 | | <br class="clear" /> |
1191 | | </div> |
1192 | | <?php |
| 1179 | if ( $this->has_items() ): ?> |
| 1180 | <div class="tablenav <?php echo esc_attr( $which ); ?>"> |
| 1181 | <div class="alignleft actions bulkactions"> |
| 1182 | <?php $this->bulk_actions( $which ); ?> |
| 1183 | </div> |
| 1184 | <?php $this->extra_tablenav( $which ); |
| 1185 | $this->pagination( $which ); ?> |
| 1186 | <br class="clear"/> |
| 1187 | </div> |
| 1188 | <?php |
| 1189 | endif; |
1193 | 1190 | } |
1194 | 1191 | |
1195 | 1192 | /** |
diff --git tests/phpunit/tests/admin/includesListTable.php tests/phpunit/tests/admin/includesListTable.php
index b6696e4..03cc8ea 100644
|
|
class Tests_Admin_includesListTable extends WP_UnitTestCase { |
9 | 9 | protected static $grandchildren = array(); |
10 | 10 | protected static $post_ids = array(); |
11 | 11 | |
| 12 | /** |
| 13 | * @var WP_Posts_List_Table |
| 14 | */ |
| 15 | protected $table; |
| 16 | |
12 | 17 | function setUp() { |
13 | 18 | parent::setUp(); |
14 | 19 | set_current_screen( 'edit-page' ); |
… |
… |
class Tests_Admin_includesListTable extends WP_UnitTestCase { |
191 | 196 | } |
192 | 197 | } |
193 | 198 | |
| 199 | /** |
| 200 | * @ticket 37407 |
| 201 | */ |
| 202 | public function test_tablenav_is_not_shown_when_there_are_no_items() { |
| 203 | ob_start(); |
| 204 | $this->table->display(); |
| 205 | $output = ob_get_clean(); |
| 206 | |
| 207 | $this->assertNotContains( '<div class="tablenav', $output ); |
| 208 | } |
194 | 209 | } |