Trigger Profile Field Updates

Execute custom functionality on user profile data updation.

Define Custom Fields for Triggering Update

Filter

– upme_trigger_field_update

Description

– Define the custom fields for triggering updates. Once user updates the defined fields, you will have the option to execute custom actions or send notifications. Following example triggers custom actions on updation of first and last name for each user.

Parameters

– Current specified fields(Empty array) , Various parameters(user_id => ‘ID of the profile owner’)

Usage
add_filter('upme_trigger_field_update','upme_trigger_field_update',10,2);
function upme_trigger_field_update($fields,$params){
	$fields = array('first_name','last_name');
	return $fields;
}

Send Notifications to Admin on Field Updates

Action

– upme_profile_field_update_triggered

Description

– Executes custom actions after triggering updates on fields specified in previous code. Following example sends admin notifications on updation of first and last name for each user.

Parameters

– Various parameters(user_id => ‘ID of the profile owner’, changed_fields => ‘Fields that have an updated value’)

Usage
add_action('upme_profile_field_update_triggered','upme_profile_field_update_triggered'); 
function upme_profile_field_update_triggered($params){
	global $upme_save;
	$upme_save->notify_field_update = true;
}

Get your copy of User Profiles Made Easy on CodeCanyon