Skip Navigation

[Resolved] Adding user registration to a post submission form

This support ticket is created 6 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
#631972

We currently have a custom post type and submission form that allows the public to submit posts in draft form.

We'd like to add a user registration element that would allow them to register as a user at the same time they submit the post and once approved, would be able to login and edit their post.

Can you point me to documentation on that topic?

Thanks,

John

#632141

Hi, CRED forms can create/edit posts, or they can create/edit Users. There's not a way to accomplish both tasks in one form, unfortunately. Considering what you'd like to accomplish, here's what I can advise. If the guest submits a post first, then that post has no author assigned in wp-admin and no reference to the guest. Then if the guest submits a separate registration form, there's not a good way to then retroactively apply the new User as author of the post they created before registering. It will require manual intervention in the wp-admin area if the guest does not register as a User right away, because there is no association maintained between the guest and the post.

If the User registers immediately after posting, you may be able to use some custom programming with the CRED API to apply the new User as author of the post: https://toolset.com/documentation/programmer-reference/cred-api/
But the CRED API alone will not be helpful if the guest does not register immediately after submitting the post, because no association is maintained between the guest and the post. Manual intervention would be required at that point.

#632155

Thanks Christian.

So If I created a user after they made a post, could I assign their post to them?

I tried doing that, but I can't find an author field in the posts created by my toolset setup. Is that a field I need to add manually?

#636641

Correct, you can assign the author in wp-admin manually. If you cannot see the Author field in wp-admin, you must enable it in one or two places:
- In the post editor screen in wp-admin, scroll to the top right corner and click "Screen Options" tab. Look for the author checkbox here. Check it to display the author field in the editor. If the checkbox is not visible, it must be activated in the post type editor. Go to the next step
- Go to Toolset > Post Types and edit this post type. Look for the panel "Sections to display when editing..." and toggle it open if necessary. Check the Author option and save.
- Repeat first step if necessary

#652168

Thanks Christian for your help. I'm a little stumped that Toolset doesn't provide an easy way to create a post and a user for that post at the same time. It seems like a pretty common event (I'm always being asked to create accounts when I place orders, for example).