Skip to content

Commit 7dae010

Browse files
committed
Administration: Avoid rendering empty bottom tablenav container when pagination is hidden.
This changeset removes the bottom `tablenav` container on taxonomy term list screens when it contains a hidden `.tablenav-pages.no-pages` element, to prevent unnecessary vertical spacing when no tags exist. Props sainathpoojary, dilipbheda, audrasjb, abcd95, dhruvang21, SirLouen. Fixes #63369. git-svn-id: https://develop.svn.wordpress.org/trunk@60613 602fd350-edb4-49c9-b593-d223f7449a82
1 parent f9e61f6 commit 7dae010

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/wp-admin/includes/class-wp-list-table.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ protected function get_items_per_page( $option, $default_value = 20 ) {
10211021
* @param string $which The location of the pagination: Either 'top' or 'bottom'.
10221022
*/
10231023
protected function pagination( $which ) {
1024-
if ( empty( $this->_pagination_args ) ) {
1024+
if ( empty( $this->_pagination_args['total_items'] ) ) {
10251025
return;
10261026
}
10271027

@@ -1668,6 +1668,9 @@ protected function get_table_classes() {
16681668
* @param string $which The location of the navigation: Either 'top' or 'bottom'.
16691669
*/
16701670
protected function display_tablenav( $which ) {
1671+
if ( 'bottom' === $which && ! $this->has_items() ) {
1672+
return;
1673+
}
16711674
if ( 'top' === $which ) {
16721675
wp_nonce_field( 'bulk-' . $this->_args['plural'] );
16731676
}

0 commit comments

Comments
 (0)