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
This commit is contained in:
Sergey Biryukov 2020-07-03 16:26:57 +00:00
parent 88c91eeaa6
commit a0891d732e

View File

@ -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 )