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.
Built from https://develop.svn.wordpress.org/trunk@46209


git-svn-id: http://core.svn.wordpress.org/trunk@46021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-09-20 20:30:58 +00:00
parent e589297afc
commit d2ebf7d0e4
2 changed files with 10 additions and 2 deletions

View File

@ -234,7 +234,15 @@ function _wp_personal_data_cleanup_requests() {
* @return string The HTML for this group and its items.
*/
function wp_privacy_generate_personal_data_export_group_html( $group_data ) {
$group_html = '<h2>' . esc_html( $group_data['group_label'] ) . '</h2>';
$group_html = '<h2>';
$group_html .= esc_html( $group_data['group_label'] );
$items_count = count( (array) $group_data['items'] );
if ( $items_count > 1 ) {
$group_html .= sprintf( ' <span class="count">(%d)</span>', $items_count );
}
$group_html .= '</h2>';
if ( ! empty( $group_data['group_description'] ) ) {
$group_html .= '<p>' . esc_html( $group_data['group_description'] ) . '</p>';

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-46208';
$wp_version = '5.3-alpha-46209';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.