Skip Navigation

[Resolved] Save user data in a CPT after edit profile using Cred forms

This support ticket is created 3 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by sergioC-13 3 years ago.

Assisted by: Shane.

Author
Posts
#2429539

Tell us what you are trying to do?
Hello, first of all im sorry about my english.
I am creating a project in which: 1- a visitor fills out the User registration form. 2- The moderator confirms the data and assigns the Student role from the dashboard. 3- At that moment a custom function is executed, which passes the user data to the dedicated cpt.
4- If a user with the Student role is modified from the dashboard side, the second custom function is activated which updates the fields of the CPT Student.
Until here, all good.
THE PROBLEM:
If a user with the Student role edits his user profile from the frontend with the toolset form, obviously he only updates the user data.
QUESTION: Is it possible, in some way, that I also update the fields of the Student CPT?
Is there any documentation that you are following?
no
Is there a similar example that we can see?
no
What is the link to your site?
is a test subfolder. If you require it, I could share the link.

#2429611

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sergio,

Thank you for the getting in touch.

Actually yes this is possible, that same function that you're using on the backend can also be adapted to the frontend with the following hook.
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

The hook above triggers when a form is submitted on the frontend so you should be able to use this to update the student's profile as well.

Thanks,
Shane

#2429683

My issue is resolved now. Thank you!