Skip to content
Docs
Get RestroPress

Filter

rpress_privacy_customer_record

Updated
On this page

Filters the customer record group in a personal data export.

Runs in rpress_privacy_customer_record_exporter() after the 'Customer Record' group has been assembled (customer ID, primary email, name, creation date, all emails and any recorded terms or privacy agreement times). The group is an array with 'group_id', 'group_label', 'item_id' and a 'data' list of name and value pairs.

Parameters#

ParameterTypeDescription
$export_dataarrayThe export group with 'group_id', 'group_label', 'item_id' and 'data'.
$customerRPRESS_CustomerThe customer being exported.

Return value#

array. The export group.

Example#

add_filter( 'rpress_privacy_customer_record', 'my_export_customer_phone', 10, 2 );
function my_export_customer_phone( $export_data, $customer ) {
	$phone = $customer->get_meta( 'my_phone' );
	if ( $phone ) {
		$export_data['data'][] = array(
			'name'  => __( 'Phone', 'my-plugin' ),
			'value' => $phone,
		);
	}
	return $export_data;
}

Source#

Applied in:

  • includes/privacy-functions.php (line 545), in rpress_privacy_customer_record_exporter()

See also#

Was this page helpful?