Skip Navigation

[Resolved] Create a user and post in the same Form

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to use one Form to create a new User and a new post at the same time.

Solution: Forms can either create a User or create a post of some kind, but not both. Combining these two features would require some custom code using the cred_save_data API. Another approach uses two Forms and conditional HTML to display or hide the second Form after the first Form is submitted.

This support ticket is created 6 years, 5 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)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 6 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1069313

I'm using a post form to create a content submission form where the user can create a custom page. Most similar to a classifieds site. However, I also need the user to create an account so they can manage their post. It seems that would include a user form but I'm not sure how to get both in the same process.

hidden link

thanks

#1069478

Hi, it's currently possible to either create a User or create a post of some kind with one Form. It's not currently possible to do both without a significant amount of custom code. If you're comfortable writing PHP, you can use the cred_save_data API to capture some generic field values entered in a new User Form. If you're not comfortable with PHP, my best advice is to create a new User Form and create a new post Form. Display the new User Form first.

Next create a View that displays the post created by the User by filtering on post Author. If any results are found, do not show the new post Form. If no results are found, show the new post Form. You can use the wpv-items-found and wpv-no-items-found tags in the View's Loop editor to show or hide the new post Form. Then insert this View on a custom Page where Users will be directed to after login.