WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/20/2019 08:29:30 PM (3 months ago)
Author:
SergeyBiryukov
Message:

Privacy: Display group items count in the personal data export file if there's more than one item in the group.

Props birgire, garrett-eclipse, pputzer.
Fixes #46895.

File:
1 edited

Legend:

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

    r45932 r46209  
    235235 */
    236236function wp_privacy_generate_personal_data_export_group_html( $group_data ) {
    237     $group_html = '<h2>' . esc_html( $group_data['group_label'] ) . '</h2>';
     237    $group_html  = '<h2>';
     238    $group_html .= esc_html( $group_data['group_label'] );
     239
     240    $items_count = count( (array) $group_data['items'] );
     241    if ( $items_count > 1 ) {
     242        $group_html .= sprintf( ' <span class="count">(%d)</span>', $items_count );
     243    }
     244
     245    $group_html .= '</h2>';
    238246
    239247    if ( ! empty( $group_data['group_description'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.