[wp-trac] [WordPress Trac] #44151: Personal data exports - lower priority exporters should place their data after the higher priority ones
WordPress Trac
noreply at wordpress.org
Fri May 18 17:32:29 UTC 2018
#44151: Personal data exports - lower priority exporters should place their data
after the higher priority ones
----------------------------+------------------------------
Reporter: robobot3000 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Privacy | Version: trunk
Severity: normal | Resolution:
Keywords: gdpr has-patch | Focuses:
----------------------------+------------------------------
Comment (by allendav):
I've also confirmed this - @robobot3000 - note that your code snippet is
not a proper exporter - nor registers exporters correctly - you need an
array of arrays for data, i.e.:
{{{#!php
<?php
function exporter_1( $email_address, $page = 1 ) {
return array(
'data' => array( array(
'group_id' => 'group-1',
'group_label' => __( 'Orders', 'woocommerce-
services' ),
'item_id' => 'item-1',
'data' => array(
array(
'name' => __( 'Exporter 1' ),
'value' => 1234,
),
),
) ),
'done' => true,
);
}
function exporter_2( $email_address, $page = 1 ) {
return array(
'data' => array( array(
'group_id' => 'group-1',
'group_label' => __( 'Orders', 'woocommerce-
services' ),
'item_id' => 'item-1',
'data' => array(
array(
'name' => __( 'Exporter 2' ),
'value' => 4567,
),
),
) ),
'done' => true,
);
}
function register_exporter_1( $exporters ) {
$exporters['exporter_1'] = array(
'exporter_friendly_name' => __( 'Exporter 1' ),
'callback' => 'exporter_1',
);
return $exporters;
}
add_filter(
'wp_privacy_personal_data_exporters',
'register_exporter_1',
5
);
function register_exporter_2( $exporters ) {
$exporters['exporter_2'] = array(
'exporter_friendly_name' => __( 'Exporter 2' ),
'callback' => 'exporter_2',
);
return $exporters;
}
add_filter(
'wp_privacy_personal_data_exporters',
'register_exporter_2',
10
);
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44151#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list