Privacy: Add descriptions for sections in a personal data export file.

Props garrett-eclipse, Venutius, karmatosed.
Fixes #45491.
Built from https://develop.svn.wordpress.org/trunk@45825


git-svn-id: http://core.svn.wordpress.org/trunk@45636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-08-18 02:07:57 +00:00
parent 53f5b172ab
commit d9954ed4cb
5 changed files with 35 additions and 18 deletions

View File

@ -234,7 +234,12 @@ 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>' . esc_html( $group_data['group_label'] ) . '</h2>';
if ( ! empty( $group_data['group_description'] ) ) {
$group_html .= '<p>' . esc_html( $group_data['group_description'] ) . '</p>';
}
$group_html .= '<div>';
foreach ( (array) $group_data['items'] as $group_item_id => $group_item_data ) {
@ -355,8 +360,10 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) {
// First, build an "About" group on the fly for this report.
$about_group = array(
/* translators: Header for the About section in a personal data export. */
'group_label' => _x( 'About', 'personal data group label' ),
'items' => array(
'group_label' => _x( 'About', 'personal data group label' ),
/* translators: Description for the About section in a personal data export. */
'group_description' => _x( 'Overview of export report.', 'personal data group description' ),
'items' => array(
'about-1' => array(
array(
'name' => _x( 'Report generated for', 'email address' ),
@ -613,10 +620,17 @@ function wp_privacy_process_personal_data_export_page( $response, $exporter_inde
foreach ( (array) $export_data as $export_datum ) {
$group_id = $export_datum['group_id'];
$group_label = $export_datum['group_label'];
$group_description = '';
if ( ! empty( $export_datum['group_description'] ) ) {
$group_description = $export_datum['group_description'];
}
if ( ! array_key_exists( $group_id, $groups ) ) {
$groups[ $group_id ] = array(
'group_label' => $group_label,
'items' => array(),
'group_label' => $group_label,
'group_description' => $group_description,
'items' => array(),
);
}

View File

@ -3434,10 +3434,11 @@ function wp_comments_personal_data_exporter( $email_address, $page = 1 ) {
}
$data_to_export[] = array(
'group_id' => 'comments',
'group_label' => __( 'Comments' ),
'item_id' => "comment-{$comment->comment_ID}",
'data' => $comment_data_to_export,
'group_id' => 'comments',
'group_label' => __( 'Comments' ),
'group_description' => __( 'User&#8217;s comment data.' ),
'item_id' => "comment-{$comment->comment_ID}",
'data' => $comment_data_to_export,
);
}

View File

@ -4307,10 +4307,11 @@ function wp_media_personal_data_exporter( $email_address, $page = 1 ) {
);
$data_to_export[] = array(
'group_id' => 'media',
'group_label' => __( 'Media' ),
'item_id' => "post-{$post->ID}",
'data' => $post_data_to_export,
'group_id' => 'media',
'group_label' => __( 'Media' ),
'group_description' => __( 'User&#8217;s media data.' ),
'item_id' => "post-{$post->ID}",
'data' => $post_data_to_export,
);
}
}

View File

@ -2994,10 +2994,11 @@ function wp_user_personal_data_exporter( $email_address ) {
}
$data_to_export[] = array(
'group_id' => 'user',
'group_label' => __( 'User' ),
'item_id' => "user-{$user->ID}",
'data' => $user_data_to_export,
'group_id' => 'user',
'group_label' => __( 'User' ),
'group_description' => __( 'User&#8217;s profile data.' ),
'item_id' => "user-{$user->ID}",
'data' => $user_data_to_export,
);
return array(

View File

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