GDPR
GDPR copied to clipboard
Customize export data
Hello,
I would like to customize the export data :
- rewrite the tag 'Metadata'
- add some new data
There is a filters call :
$extra_content = apply_filters( 'gdpr_export_data_extra_tables', '', $email );
But impossible to define 2 filters :
add_filter('gdpr_export_data_extra_tables', function($empty, $email) {
return array('name' => 'test 1', 'content' => 'data 1');
}, 10, 2);
add_filter('gdpr_export_data_extra_tables', function($empty, $email) {
return array('name' => 'test 2', 'content' => 'data 2');
}, 11, 2);
Only the 'TEST 2' is taken...
Maybe will it be best to call a filter after the first array initialization. Means replace the line :
if ( $extra_content ) {
$json[ $extra_content['name'] ] = $extra_content['content'];
}
by
$json = apply_filters( 'gdpr_export_data_extra_tables', $json, $email );
So we can have access to all the json data...
Vincent
Thank you Vincent. I will make the adjustment for the next release.