WordPress.org

Make WordPress Core

Ticket #47495: 47495.diff

File 47495.diff, 1.1 KB (added by pbiron, 2 years ago)
  • src/wp-admin/includes/class-wp-privacy-requests-table.php

    From f39cea1d7bb58ebc13475e852568788c36dfd298 Mon Sep 17 00:00:00 2001
    From: Paul Biron <paul@sparrowhawkcomputing.com>
    Date: Thu, 6 Jun 2019 11:15:37 -0600
    Subject: [PATCH] Don't output a privacy request view if when the request count
     for that view is 0.
    
    ---
     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 fe5a516431..148ea21930 100644
    a b abstract class WP_Privacy_Requests_Table extends WP_List_Table { 
    177177                        $current_link_attributes = $status === $current_status ? ' class="current" aria-current="page"' : '';
    178178                        $total_status_requests   = absint( $counts->{$status} );
    179179
     180                        if ( ! $total_status_requests ) {
     181                                continue;
     182                        }
     183
    180184                        $status_label = sprintf(
    181185                                translate_nooped_plural( $post_status->label_count, $total_status_requests ),
    182186                                number_format_i18n( $total_status_requests )