fbpx

push_user_meta()

#Overview

This function allows you to sync WordPress user metadata to fields in your CRM.

#Sending specific data

You can send specific fields by providing an array of field names and values.

$update_data = array(
	'first_name'   => 'Joe'
	'custom_field' => 'Custom Value'
)

wp_fusion()->user->push_user_meta( $user_id, $update_data );

The field keys should be WordPress meta fields keys. WP Fusion will use the field mapping you’ve set on the Contact Fields tab to associate the data with the corresponding fields in your CRM.

#Parameters

push_user_meta( $user_id, $user_meta = false )
  • $user_id (int) (Required): The user ID to push meta data to.
  • $user_meta (int) (Optional): The user meta to push.

#Return

(bool) The success status.

#Sending all user data

You can also omit the array of update data, and WP Fusion will get all of the information it can find about the user from the database and send it to your CRM.

wp_fusion()->user->push_user_meta( $user_id );

 

Was this helpful?