mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-02 08:10:04 +00:00
Privacy: Include request counts inline with the filters in the list table views.
Fixes $44952 Props eArtboard, pratikkry, birgire, garrett-eclipse. git-svn-id: https://develop.svn.wordpress.org/trunk@44668 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1164,13 +1164,15 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table {
|
||||
$views = array();
|
||||
$admin_url = admin_url( 'tools.php?page=' . $this->request_type );
|
||||
$counts = $this->get_request_counts();
|
||||
$total_requests = absint( array_sum( (array) $counts ) );
|
||||
|
||||
$current_link_attributes = empty( $current_status ) ? ' class="current" aria-current="page"' : '';
|
||||
$views['all'] = '<a href="' . esc_url( $admin_url ) . "\" $current_link_attributes>" . esc_html__( 'All' ) . ' <span class="count">(' . absint( array_sum( (array) $counts ) ) . ')</span></a>';
|
||||
$views['all'] = '<a href="' . esc_url( $admin_url ) . "\" $current_link_attributes>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%d)</span>', $total_requests, 'requests' ), number_format_i18n( $total_requests ) ) . '</a>';
|
||||
|
||||
foreach ( $statuses as $status => $label ) {
|
||||
$current_link_attributes = $status === $current_status ? ' class="current" aria-current="page"' : '';
|
||||
$views[ $status ] = '<a href="' . esc_url( add_query_arg( 'filter-status', $status, $admin_url ) ) . "\" $current_link_attributes>" . esc_html( $label ) . ' <span class="count">(' . absint( $counts->$status ) . ')</span></a>';
|
||||
$total_status_requests = absint( $counts->$status );
|
||||
$views[ $status ] = '<a href="' . esc_url( add_query_arg( 'filter-status', $status, $admin_url ) ) . "\" $current_link_attributes>" . sprintf( _nx( '%1$s <span class="count">(%2$d)</span>', '%1$s <span class="count">(%2$d)</span>', $total_status_requests, 'requests' ), esc_html( $label ), number_format_i18n( $total_status_requests ) ) . '</a>';
|
||||
}
|
||||
|
||||
return $views;
|
||||
|
||||
Reference in New Issue
Block a user