From a0891d732ef95b0c20aea5c00b01b4fba37ce34e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 3 Jul 2020 16:26:57 +0000 Subject: [PATCH] Privacy: Hide views that have a count of 0 on privacy request tables, for consistency with other list tables. Props pbiron, garrett-eclipse, mapk, melchoyce, estelaris. Fixes #47495. git-svn-id: https://develop.svn.wordpress.org/trunk@48284 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-privacy-requests-table.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp-admin/includes/class-wp-privacy-requests-table.php b/src/wp-admin/includes/class-wp-privacy-requests-table.php index 23c31b1f31..714e087ab4 100644 --- a/src/wp-admin/includes/class-wp-privacy-requests-table.php +++ b/src/wp-admin/includes/class-wp-privacy-requests-table.php @@ -179,6 +179,10 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { $current_link_attributes = $status === $current_status ? ' class="current" aria-current="page"' : ''; $total_status_requests = absint( $counts->{$status} ); + if ( ! $total_status_requests ) { + continue; + } + $status_label = sprintf( translate_nooped_plural( $post_status->label_count, $total_status_requests ), number_format_i18n( $total_status_requests )