Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions src/wp-admin/includes/privacy-tools.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -357,9 +357,6 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) {
$email_address
);

// And now, all the Groups.
$groups = get_post_meta( $request_id, '_export_data_grouped', true );

// 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. */
Expand DownExpand Up@@ -388,10 +385,24 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) {
),
);

// Merge in the special about group.
$groups = array_merge( array( 'about' => $about_group ), $groups );
// And now, all the Groups.
$groups = get_post_meta( $request_id, '_export_data_grouped', true );
if ( is_array( $groups ) ) {
$groups = array_merge( array( 'about' => $about_group ), $groups );
$groups_count = count( $groups );
} else {
if ( false !== $groups ) {
_doing_it_wrong(
__FUNCTION__,
/* translators: %s: post meta key. */
sprintf( __( 'The %s post meta must be an array.' ), "<code>'_export_data_grouped'</code>" ),
'5.8.0'
);
}

$groups_count = count( $groups );
$groups = null;
$groups_count = 0;
}

// Convert the groups to JSON format.
$groups_json = wp_json_encode( $groups );
Expand Down
Loading