This function retrieves a user’s CRM contact ID based on their WordPress user ID.

#Get the current user’s contact ID

$contact_id = wpf_get_contact_id();

#Get the contact ID for a different user

$contact_id = wpf_get_contact_id( $user_id );

#Force an update of the user’s contact ID by sending an API call to your CRM

In this case the updated contact ID will automatically be saved to the local user meta after it’s been retrieved.

$contact_id = wpf_get_contact_id( $user_id, true );

Was this helpful?