Skip Navigation

[Resolved] How to integrate user registration form with post type?

This support ticket is created 4 years, 11 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Author
Posts
#1394183

Hi,

I have a custom post type using toolset. Now I want my users to Register on the website and fill the post fields. So basically I want to club user registration and post type content addition together.

How to go about doing this?

#1394243

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Actually. post forms and user forms are different entities. Basically, you can not club user form and post form field.

But as a workaround:
You can display post fields on User forms by adding the post fields as generic fields to your user form and later of use the Toolset form's API hook - cred_save_data to create the new entry for your post type based on the generic field values.

First, insert the generic fields to your user form:
=> https://toolset.com/documentation/user-guides/inserting-generic-fields-into-forms/

Then, You can use the hook: cred_save_data:
=> https://toolset.com/documentation/user-guides/cred-api/#csd

Now, using the above hook you can create child entry using the WordPress function - wp_insert_post:
=> https://developer.wordpress.org/reference/functions/wp_insert_post/

you can add your custom code to "Custom Code" section. Please check the following doc:
=> https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/

Please check the following related tickets that may help you:
=> https://toolset.com/forums/topic/creating-a-custom-post-type-with-cred-and-user-registration-at-the-same-time/#post-1182310