Make WordPress Core

Changeset 45825


Ignore:
Timestamp:
08/18/2019 02:07:00 AM (7 years ago)
Author:
SergeyBiryukov
Message:

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

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

Location:
trunk
Files:
5 edited

Legend:

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

    r45818 r45825  
    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>' . esc_html( $group_data['group_label'] ) . '</h2>';
     238
     239        if ( ! empty( $group_data['group_description'] ) ) {
     240                $group_html .= '<p>' . esc_html( $group_data['group_description'] ) . '</p>';
     241        }
     242
    238243        $group_html .= '<div>';
    239244
     
    356361        $about_group = array(
    357362                /* translators: Header for the About section in a personal data export. */
    358                 'group_label' => _x( 'About', 'personal data group label' ),
    359                 'items'       => array(
     363                'group_label'       => _x( 'About', 'personal data group label' ),
     364                /* translators: Description for the About section in a personal data export. */
     365                'group_description' => _x( 'Overview of export report.', 'personal data group description' ),
     366                'items'             => array(
    360367                        'about-1' => array(
    361368                                array(
     
    614621                $group_id    = $export_datum['group_id'];
    615622                $group_label = $export_datum['group_label'];
     623
     624                $group_description = '';
     625                if ( ! empty( $export_datum['group_description'] ) ) {
     626                        $group_description = $export_datum['group_description'];
     627                }
     628
    616629                if ( ! array_key_exists( $group_id, $groups ) ) {
    617630                        $groups[ $group_id ] = array(
    618                                 'group_label' => $group_label,
    619                                 'items'       => array(),
     631                                'group_label'       => $group_label,
     632                                'group_description' => $group_description,
     633                                'items'             => array(),
    620634                        );
    621635                }
  • trunk/src/wp-includes/comment.php

    r45739 r45825  
    34353435
    34363436                $data_to_export[] = array(
    3437                         'group_id'    => 'comments',
    3438                         'group_label' => __( 'Comments' ),
    3439                         'item_id'     => "comment-{$comment->comment_ID}",
    3440                         'data'        => $comment_data_to_export,
     3437                        'group_id'          => 'comments',
     3438                        'group_label'       => __( 'Comments' ),
     3439                        'group_description' => __( 'User&#8217;s comment data.' ),
     3440                        'item_id'           => "comment-{$comment->comment_ID}",
     3441                        'data'              => $comment_data_to_export,
    34413442                );
    34423443        }
  • trunk/src/wp-includes/media.php

    r45737 r45825  
    43084308
    43094309                        $data_to_export[] = array(
    4310                                 'group_id'    => 'media',
    4311                                 'group_label' => __( 'Media' ),
    4312                                 'item_id'     => "post-{$post->ID}",
    4313                                 'data'        => $post_data_to_export,
     4310                                'group_id'          => 'media',
     4311                                'group_label'       => __( 'Media' ),
     4312                                'group_description' => __( 'User&#8217;s media data.' ),
     4313                                'item_id'           => "post-{$post->ID}",
     4314                                'data'              => $post_data_to_export,
    43144315                        );
    43154316                }
  • trunk/src/wp-includes/user.php

    r45716 r45825  
    29952995
    29962996        $data_to_export[] = array(
    2997                 'group_id'    => 'user',
    2998                 'group_label' => __( 'User' ),
    2999                 'item_id'     => "user-{$user->ID}",
    3000                 'data'        => $user_data_to_export,
     2997                'group_id'          => 'user',
     2998                'group_label'       => __( 'User' ),
     2999                'group_description' => __( 'User&#8217;s profile data.' ),
     3000                'item_id'           => "user-{$user->ID}",
     3001                'data'              => $user_data_to_export,
    30013002        );
    30023003
  • trunk/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php

    r45148 r45825  
    143143                $data = array(
    144144                        array(
    145                                 'group_id'    => 'custom-exporter-group-id',
    146                                 'group_label' => 'custom-exporter-group-label',
    147                                 'item_id'     => 'custom-exporter-item-id',
    148                                 'data'        => array(
     145                                'group_id'          => 'custom-exporter-group-id',
     146                                'group_label'       => 'Custom Exporter Group Label',
     147                                'group_description' => 'Custom Exporter Group Description',
     148                                'item_id'           => 'custom-exporter-item-id',
     149                                'data'              => array(
    149150                                        array(
    150151                                                'name'  => 'Email',
Note: See TracChangeset for help on using the changeset viewer.