Skip to content
Permalink
Browse files

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

Props garrett-eclipse, Venutius, karmatosed.
Fixes #45491.

git-svn-id: https://develop.svn.wordpress.org/trunk@45825 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
SergeyBiryukov committed Aug 18, 2019
1 parent 6f30523 commit 95c36ce5ba83585efccc4005a0c1dd5b823de799
@@ -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(),
);
}
@@ -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,
);
}
@@ -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,
);
}
}
@@ -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(
@@ -142,10 +142,11 @@ public static function wpSetUpBeforeClass( $factory ) {
$data = array(
array(
'group_id' => 'custom-exporter-group-id',
'group_label' => 'custom-exporter-group-label',
'item_id' => 'custom-exporter-item-id',
'data' => array(
'group_id' => 'custom-exporter-group-id',
'group_label' => 'Custom Exporter Group Label',
'group_description' => 'Custom Exporter Group Description',
'item_id' => 'custom-exporter-item-id',
'data' => array(
array(
'name' => 'Email',
'value' => self::$requester_email,

0 comments on commit 95c36ce

Please sign in to comment.
You can’t perform that action at this time.