Skip Navigation

[Resolved] Create custom post when new user register

This support ticket is created 2 years, 8 months 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#2136789

Dear Sir/Madam,

Does Toolset have any hook that I can call to create a custom post like "Student" if a new user registers as a student? Is there any hook that I can update the custom post if I update from the backend? For example, when I update the WP user's display name, once I update, then the hook will automatically update the custom post's title same as the display name, in the custom post I will have more additional information like what class the student enrolled.

Best regards,

Kelvin.

#2137999

Does Toolset have any hook that I can call to create a custom post like "Student" if a new user registers as a student?
If students register using Toolset Forms, then you can use the cred_save_data or cred_submit_complete hooks to create new custom posts. There are several tickets in the forum that contain examples. You can search Google for something like "site:toolset.com automatically create post when user registers" and find examples like these:
https://toolset.com/forums/topic/automatic-post-creation-on-registration/
https://toolset.com/forums/topic/auto-create-custom-post-after-new-user-submission/
https://toolset.com/forums/topic/have-a-band-admin-role-to-manage-cpt-band-listing-page/
If the User is the author of his or her own Student post, you can use the User ID to query posts by post author to get the Student post, then use wp_update_post or update_post_meta to update the Student post details.

Is there any hook that I can update the custom post if I update from the backend?
Toolset does not provide such a hook, but the WordPress hook profile_update is available for performing actions after a User profile is updated:
https://developer.wordpress.org/reference/hooks/profile_update/

#2142169

Dear Christian Cox,

Thanks for your reply. Both cred_save_data and cred_submit_complete are using Toolset form to create WP account, but how I can do the same if using standard WP registration or register by social account?

Best regards,

Kelvin.

#2143105

Thanks for your reply. Both cred_save_data and cred_submit_complete are using Toolset form to create WP account, but how I can do the same if using standard WP registration or register by social account?
Toolset only provides APIs for registration workflows that utilize Toolset Forms. Standard WP registration and 3rd-party registration workflows are not covered by any Toolset APIs.

I suggest you look for solutions with built-in WordPress APIs like user_register or register_new_user:
https://developer.wordpress.org/reference/hooks/user_register/
https://developer.wordpress.org/reference/hooks/register_new_user/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.