I have a Toolset > Custom Fields Group > that has a date field with the slug name = last-profile-update-on. That field shows up when I edit a user's profile in WP and behaves as expected.
I have a Toolset > User Forms > Update My Profile form that the user uses on the public side to update his profile. I want to show the user a text version of when he did his last update and then save the current datestamp of when he saves his updates into the last-profile-update-on field so that it shows up in his profile in WP.
To update the field, is the date field is available with your edit profile form, if yes, then there is no need to do anything as it will update the field value as the field is present within the update profile form.
That's the statement I use to show the user the last date that he made an update. It's displaying the date of the last update that is already in the WP User record. This is perfect.
How do I set up a hidden field on the front side form that will store the current date into the last-profile-update-on field in his WP profile when he saves his updates ?
There is no need to add the hidden field. You can use the Toolset form's hook "cred_save_data" and you can use this hook in order to update the "last-profile-update-on" user field value to current time.
Where:
- Replace 9999 with your original user form ID.
Once you add the code to new snippet and save it and activate the code snippet, you should try to update the profile and check if the field gets updated automatically or not.