Skip Navigation

[Resolved] Manual memberships and linking to authors/registering users

This support ticket is created 2 years, 4 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 2 years, 4 months ago.

Assisted by: Waqar.

Author
Posts
#2447741

Hi there,

I'm running into an issue with a membership system that i set-up using Toolset that was helped devised through a previous support query, and i'm unsure how to fix a problem that occurs as a result of the workflow that's been set up.

Basically on the site i've developed with Toolset, users are able to fill out a form (using the Gravity form plugin) that gathers a whole lot of details for their membership, things like address, profession etc. The data from those forms then feeds into a custom post named "Members" and creates a new draft post with all those fields auto-filled with the data from the form. The most important part though, is that the post itself registers the user who filled out the form as the Author (even if they don't actually have editor privileges in WordPress), and that's extremely important because the users profile page uses the data from that post they've authored as a way for them to see and update all their personal details.

The issue is however, some members sign up outside of the website (through filling out forms and sending them to staff members), and those staff then create the members profile manually on the back-end. They aren't massively tech savvy, so anything past the simple data entry usually needs to be automated. The problem is whenever they create those member profiles in the custom "members" post type on the back end, it registers the staff member as the author, and thus the member has no associated data on their profile pages. Even if they wanted to set the Author manually, it would be impossible as the WordPress drop-down option only allows admins to be selected as authors, so it wouldn't be possible anyways. The other issue is that this creates a member, but there's no associated User to link it with either. I've been manually solving this problem by going into the database and manually changing the posts author ID's to the relevant user ID, but is there a way to automate this process?

I'd like to make it possible either through the back-end custom post, or perhaps even through an admin Toolset form for the staff so that they can just input the members data, and it will create the members post, generate a user for said member, and set that user as the author. Is this possible?

Any help would be greatly appreciated.

#2447949

Hi,

Thank you for contacting us and I'd be happy to assist.

From what you've shared, I understand that the website already has a working front-end form ( built using the Gravity form ), which performs all 3 operations:

1. Create a new user
2. Create a new "Members" post
3. Set the newly created user as the author of the newly created "Members" post.

If that is correct, can't the staff members, use that same form to register on behalf of other users who have shared data through some different channel?
(i.e. use the form as a visitor and not logged in as an admin or staff user)

There is no built-in function available, which can be used to automate all these operations, using a single form in the admin area. And to accomplish something like this using a front-end Toolset Form, would also require some workarounds and custom code.

You'll find the relevant information on this topic in these forum threads:
https://toolset.com/forums/topic/creating-a-profile-cpt-at-the-same-time-as-a-user-is-registering/
https://toolset.com/forums/topic/using-woocommerce-and-cred_save_data-to-create-a-custom-post-type/

regards,
Waqar

#2447963

Hi Waqar,

Thanks for getting back. That would be an ideal option, however the one issue is that the front-end form doesn't create the user, if it did, or could, that would be great. Currently a guest has to register as a new user, and afterwards fill out the form that registers them as a member, that's the only way to get the form to register them as an author. Is it possible to add some sort of functionality to that form to create a user with it, and if so, is there a way to make it so that an admin can fill that form and create one for them without it misplacing the admin as the author and rather the newly registered user?

Regards,
Nathan

#2449231

Thank you for sharing these details.

Ok, in that case, you'll need to check with the Gravity Form's support team to see if there is a simple way to make that 'create a member post' form to also register a new user.

From the Toolset Forms perspective, you can use one user form to register a new user and also programmatically add a member post with that new user set as its post author.
( ref: https://toolset.com/forums/topic/creating-a-profile-cpt-at-the-same-time-as-a-user-is-registering/ )

Then after login into the member's area, you can show the form to edit that 'member' post, so that the user can fill in the information that was not collected at the time of registration and complete the member profile.