[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 21:05:57 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:
---------------------------------------------------+-----------------------

Comment (by pbiron):

 Just gave the patch a spin and it seems to work great...and is much easier
 than registering a separate exporter.

 It correctly does **not** allow altering the data that core exports for a
 user.

 One question though: it **does** allow a plugin to add items with the same
 title/name as those exported by core but with a different value...which
 ''might'' be confusing to users.  For example:

 {{{
 <?php

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

                 $additional_data = array(
                         array(
                                 'name'  => __( 'User ID', 'a-plugin' ),
                                 'value' => '127',
                         ),
                         array(
                                 'name'  => __( 'User Login Name',
 'a-plugin' ),
                                 'value' => 'anotherrandomuser',
                         ),
                 );

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

 I do **not** think it would be worth stripping out such items from the
 result of applying the filter...but I just wanted to mention it in case
 anyone else things it would be a good idea.

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


More information about the wp-trac mailing list