wpf_user_updated

wpf_user_updated

#Overview
This action is triggered whenever updated meta data is loaded from a CRM contact record for a user.
#Parameters

$user_id: The user ID
$user_meta: An array of meta fields loaded from the CRM

#Examples
#Update a user』s role based on the value of a custom field
function my_set_custom_role( $user_id, $user_meta ) {

if ( 'Active' == $user_meta['custom_field_key'] ) {

$user = new WP_User( $user_id );
$user->set_role( 'active-role' );

}

}

add_action( 'wpf_user_updated', 'my_set_custom_role', 10, 2 );

#Was this helpful?

Let us know if you liked the post. That』s the only way we can improve.

Yes

No

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注