Skip to content

Commit af57cb5

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. Built from https://develop.svn.wordpress.org/trunk@60613 git-svn-id: https://core.svn.wordpress.org/trunk@59949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 3d5d073 commit af57cb5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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
}

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.9-alpha-60612';
19+
$wp_version = '6.9-alpha-60613';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)