Regarding hooks um_before_update_profile & um_after_user_updated
-
Dear Support Team,
How to identify the changes made during update profile in the hooks um_before_update_profile & um_after_user_updated? There is an array $changes, but it holds many fields which haven’t been changed. Which fields it is supposed to hold?
To identify whether a field is modified, we tried to compare database value with value in $changes. We are able to identify if a new value is coming for a particular field in um_before_update_profile. But, that is not possible in um_after_user_updated since database value is same as new value.
Now we need to update last modification date field ( say 2nd field) based on change of a particular field (say 1st field) by the user at front-end. We tried to do that by
if (1st field in $change != 1st field in database)
{
update_user_meta($user_id, ‘last_support_date’,$current_date); in um_before_update_profile.
}But, for some reason, it is not updating. Even we tried to change the $change array so that it gets updated later in the process like
$changes[‘last_support_date’] = $current_date;
But, if we do update_user_meta($user_id, ‘last_support_date’,$current_date); in um_after_user_updated, it is perfectly updating the user profile. But, unfortunately we can not detect whether user modified the 1st field in um_after_user_updated. We also observed $changes array differs between um_before_update_profile and um_after_user_updated.
Please let us know the correct way of doing this. If you let us know the php file where you are processing this or how actually it helps, will be also fine.
- The topic ‘Regarding hooks um_before_update_profile & um_after_user_updated’ is closed to new replies.