From d2ebf7d0e4ab6447d33b7944cf642259d643b060 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 20 Sep 2019 20:30:58 +0000 Subject: [PATCH] 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 --- wp-admin/includes/privacy-tools.php | 10 +++++++++- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/privacy-tools.php b/wp-admin/includes/privacy-tools.php index a9af16d802..aa2f856e84 100644 --- a/wp-admin/includes/privacy-tools.php +++ b/wp-admin/includes/privacy-tools.php @@ -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 = '

' . esc_html( $group_data['group_label'] ) . '

'; + $group_html = '

'; + $group_html .= esc_html( $group_data['group_label'] ); + + $items_count = count( (array) $group_data['items'] ); + if ( $items_count > 1 ) { + $group_html .= sprintf( ' (%d)', $items_count ); + } + + $group_html .= '

'; if ( ! empty( $group_data['group_description'] ) ) { $group_html .= '

' . esc_html( $group_data['group_description'] ) . '

'; diff --git a/wp-includes/version.php b/wp-includes/version.php index 2fed44a854..40de1beba0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.