[wp-trac] [WordPress Trac] #47509: add a filter in wp_user_personal_data_exporter() to make it easier to include additional user meta in a personal data export

WordPress Trac noreply at wordpress.org
Tue Jan 21 17:13:01 UTC 2020


#47509: add a filter in wp_user_personal_data_exporter() to make it easier to
include additional user meta in a personal data export
---------------------------------------------------+-----------------------
 Reporter:  pbiron                                 |       Owner:  xkon
     Type:  enhancement                            |      Status:  assigned
 Priority:  normal                                 |   Milestone:  5.4
Component:  Privacy                                |     Version:
 Severity:  normal                                 |  Resolution:
 Keywords:  has-patch 2nd-opinion has-screenshots  |     Focuses:
---------------------------------------------------+-----------------------
Changes (by xkon):

 * keywords:   => has-patch 2nd-opinion has-screenshots
 * owner:  (none) => xkon
 * status:  new => assigned
 * milestone:  Awaiting Review => 5.4


Comment:

 This looks to me like a great idea for any extra data that could be bumped
 in along with the profile/meta data.

 Plugins like BuddyPress, for example, could easily merge their additional
 fields with this instead of a full new section and it would make more
 sense IMHO to have everything grouped in 1 dataset.

 [attachment:"47509.diff"] takes a first look at adding a filter there with
 simple checks to extend the existing default array.

 An author (or for anyone that wants to quickly test this) could use
 something like this:


 {{{
 <?php

 add_filter(
         'wp_privacy_additional_user_data',
         function( $additional_data, $user_default_data ) {

                 $additional_data = array(
                         array(
                                 'name'  => __( 'Data one', 'a-plugin' ),
                                 'value' => 'one',
                         ),
                         array(
                                 'name'  => __( 'Data two', 'a-plugin' ),
                                 'value' => 'two',
                         ),
                         array(
                                 'name'  => __( 'Data three', 'a-plugin' ),
                                 'value' => 'three',
                         ),
                         array(
                                 'name'  => __( 'Data four', 'a-plugin' ),
                                 'value' => 'four',
                         ),
                 );

                 return $additional_data;
         },
         10,
         2
 );
 }}}

 Everything will be placed on export after the default array as seen on
 [attachment:"47509_preview.jpg"]. I've also changed the subtitle from
 "profile data" to "meta data" as it would fit more the new content of this
 "group".

 I'll mark this for 5.4 in case we could get some extra feedback here or
 any extra patches to finalize this.

 @pbiron any thoughts :) ?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47509#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list