Make WordPress Core

Changeset 44668


Ignore:
Timestamp:
01/21/2019 05:35:00 PM (6 years ago)
Author:
desrosj
Message:

Privacy: Include request counts inline with the filters in the list table views.

Fixes $44952
Props eArtboard, pratikkry, birgire, garrett-eclipse.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/user.php

    r44643 r44668  
    11651165        $admin_url      = admin_url( 'tools.php?page=' . $this->request_type );
    11661166        $counts         = $this->get_request_counts();
     1167        $total_requests = absint( array_sum( (array) $counts ) );
    11671168
    11681169        $current_link_attributes = empty( $current_status ) ? ' class="current" aria-current="page"' : '';
    1169         $views['all']            = '<a href="' . esc_url( $admin_url ) . "\" $current_link_attributes>" . esc_html__( 'All' ) . ' <span class="count">(' . absint( array_sum( (array) $counts ) ) . ')</span></a>';
     1170        $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>';
    11701171
    11711172        foreach ( $statuses as $status => $label ) {
    11721173            $current_link_attributes = $status === $current_status ? ' class="current" aria-current="page"' : '';
    1173             $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>';
     1174            $total_status_requests   = absint( $counts->$status );
     1175            $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>';
    11741176        }
    11751177
  • trunk/src/wp-includes/post.php

    r44660 r44668  
    392392            'internal'            => true,
    393393            '_builtin'            => true, /* internal use only. */
     394            'label_count'         => _n_noop( 'Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>' ),
    394395            'exclude_from_search' => false,
    395396        )
     
    402403            'internal'            => true,
    403404            '_builtin'            => true, /* internal use only. */
     405            'label_count'         => _n_noop( 'Confirmed <span class="count">(%s)</span>', 'Confirmed <span class="count">(%s)</span>' ),
    404406            'exclude_from_search' => false,
    405407        )
     
    412414            'internal'            => true,
    413415            '_builtin'            => true, /* internal use only. */
     416            'label_count'         => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>' ),
    414417            'exclude_from_search' => false,
    415418        )
     
    422425            'internal'            => true,
    423426            '_builtin'            => true, /* internal use only. */
     427            'label_count'         => _n_noop( 'Completed <span class="count">(%s)</span>', 'Completed <span class="count">(%s)</span>' ),
    424428            'exclude_from_search' => false,
    425429        )
Note: See TracChangeset for help on using the changeset viewer.