Make WordPress Core


Ignore:
Timestamp:
02/10/2020 05:30:03 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Privacy: Include community-events-location user meta value in Personal Data Export.

The value is used by the WordPress Events and News widget to show relevant WP community events.

The location information may include an IP address, location description, and latitude/longitude coordinates.

Props garrett-eclipse, coreymckrill, xkon.
Fixes #43921.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/user.php

    r47219 r47236  
    29602960    $user_meta = get_user_meta( $user->ID );
    29612961
    2962     $user_prop_to_export = array(
     2962    $user_props_to_export = array(
    29632963        'ID'              => __( 'User ID' ),
    29642964        'user_login'      => __( 'User Login Name' ),
     
    29762976    $user_data_to_export = array();
    29772977
    2978     foreach ( $user_prop_to_export as $key => $name ) {
     2978    foreach ( $user_props_to_export as $key => $name ) {
    29792979        $value = '';
    29802980
     
    30133013    );
    30143014
     3015    /**
     3016     * Introduce any Community Events Location data that is available.
     3017     *
     3018     * @since 5.4.0
     3019     */
     3020    if ( isset( $user_meta['community-events-location'] ) ) {
     3021        $location = maybe_unserialize( $user_meta['community-events-location'][0] );
     3022
     3023        $location_props_to_export = array(
     3024            'description' => __( 'City' ),
     3025            'country'     => __( 'Country' ),
     3026            'latitude'    => __( 'Latitude' ),
     3027            'longitude'   => __( 'Longitude' ),
     3028            'ip'          => __( 'IP' ),
     3029        );
     3030
     3031        $location_data_to_export = array();
     3032
     3033        foreach ( $location_props_to_export as $key => $name ) {
     3034            if ( ! empty( $location[ $key ] ) ) {
     3035                $location_data_to_export[] = array(
     3036                    'name'  => $name,
     3037                    'value' => $location[ $key ],
     3038                );
     3039            }
     3040        }
     3041
     3042        $data_to_export[] = array(
     3043            'group_id'          => 'community-events-location',
     3044            'group_label'       => __( 'Community Events Location' ),
     3045            'group_description' => __( 'User’s location data used for the Community Events in the WordPress Events and News dashboard widget.' ),
     3046            'item_id'           => "community-events-location-{$user->ID}",
     3047            'data'              => $location_data_to_export,
     3048        );
     3049    }
     3050
    30153051    return array(
    30163052        'data' => $data_to_export,
Note: See TracChangeset for help on using the changeset viewer.