Make WordPress Core


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.

File:
1 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                }
Note: See TracChangeset for help on using the changeset viewer.