i want to update a custom user_meta field when a User changed/edit the xProfile field (width the ID 1542).
this does hook not work
function action_xprofile_data_after_save( $x )
{
print_r($x);
// if($field == 1542)
// {
// update_user_meta($user_id, 'field_1542', 'changed');
// }
}
add_action( 'xprofile_data_after_save', 'action_xprofile_data_after_save', 10, 1 );
I believe this approach works for edits made on both front-end and back-end. And it provides the
$user_id
:The above works fine in case of an edit, but not working when you “clean / remove” the text from the field. You should use something like this: