fbpx

wpf_api_update_contact_args

#Overview

This filter is run before WP Fusion syncs any custom field data to your CRM for an existing contact.

It can be used to modify the field data only in cases where a contact record already exists (as opposed to wpf_user_update which only runs for registered users, or wpf_woocommerce_customer_data, which run for both new and existing contacts).

It runs after user meta keys have been mapped to CRM field keys, and all data has been formatted via the wpf_format_field_value filter.

#Parameters

  • $args (array): The array of arguments being passed to the CRM API class.
    • 0 (string): The CRM contact ID being updated.
    • 1 (array): An associative array of CRM field keys and their values.

#Examples

#Never update the first name of an existing contact, with ActiveCampaign

Note that in this case first_name is the API field ID for the first name field, with ActiveCampaign. This will be different with each CRM.

For a reference please check your CRM’s API documentation or refer to the “API name” for custom fields in your CRM.

function never_update_first_names( $args ) {

	if ( isset( $args[1]['first_name'] ) ) {
		unset( $args[1]['first_name'] );
	}

	return $args;

}
add_filter( 'wpf_api_update_contact_args', 'never_update_first_names' );

Was this helpful?

Our Black Friday Sale is Here! 🎉

Take advantage of the biggest discount we’ve ever offered. Save 30% off new licenses and upgrades.

Days
Hours
Minutes
Seconds
Sorry, this offer has expired.

Valid until Monday December 2nd. See Terms and Conditions