rcp_edit_member

This action triggers when a member is edited in the admin area. It can be used for saving custom fields or executing code when a member is edited.

Parameters:

  • $user_id (int) - ID number of the user being edited.

Example:

/**
 * Stores the information submitted profile update
 *
 */
function pw_rcp_save_user_fields_on_profile_save( $user_id ) {

	if( ! empty( $_POST['rcp_profession'] ) ) {
		update_user_meta( $user_id, 'rcp_profession', sanitize_text_field( $_POST['rcp_profession'] ) );
	}

	if( ! empty( $_POST['rcp_location'] ) ) {
		update_user_meta( $user_id, 'rcp_location', sanitize_text_field( $_POST['rcp_location'] ) );
	}

}
add_action( 'rcp_edit_member', 'pw_rcp_save_user_fields_on_profile_save', 10 );