Skip Navigation

[Gelöst] Post edit form restricted by User relationship

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem: I would like to organize my Users by Company, and allow the Users in a Company to edit the Company post using Forms.

Solution: Use a User proxy post type or a repeating custom field to link Users and Companies, then use conditional HTML to show and hide the Edit Company Form based on those values.

Relevant Documentation:
https://toolset.com/documentation/user-guides/how-to-create-custom-searches-and-relationships-for-users/

This support ticket is created vor 6 Jahren, 3 Monaten. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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
Artikel
#1069122

I have a company listing page for an association website. Each company will have 2 members as part of association. Is it possible to give both of them edit rights of their company (custom post type) ? If yes how do I do that? I see there is am option to show if they are post author but unable to figure out how can more then one be able to edit same post.

#1069387

Hi, I have a few questions:
- Is "Members" a post type, or are members just WordPress Users?
- How are Members connected to Companies - post relationship? taxonomy? custom fields? custom role?
- Will Members have access to wp-admin, or will they be editing the Company posts with Forms on the front-end of the site?

#1069392

- Member are normal WordPress Users
- They would be made author of that particular post
- No, I do not want to give WP-admin access to members. Want to do it through frontend form.

The site is still under development so if any change is needed to member for this feature can do it.

#1069398

Your made me wonder, If I create a CPT for members, how will the have login etc like normal wordpress users? Is there are article or tutorial I can go through to create user using toolset plugin?

#1069497

Your made me wonder, If I create a CPT for members, how will the have login etc like normal wordpress users
Login would still work the same way for Users, there will be an additional custom post type called "Members" that acts as a proxy for WordPress Users. Each Member post is linked to one User because the User is the author of that Member post.

Toolset post relationships and custom search Views are not available for Users. This proxy technique can be useful if you plan to connect Users and posts in many-to-many style relationships, or if you want to use parametric search to find Users. More information about it here: https://toolset.com/documentation/user-guides/how-to-create-custom-searches-and-relationships-for-users/

Proxies are easier to manage in the back-end of the site, but a repeating custom field that stores an ID reference is easier to use in Views filters and conditionals.

- They would be made author of that particular post
Unfortunately this is not possible because standard WordPress does not allow multiple post authors for the same post. Some other method of connecting Users and posts is necessary, like a proxy post, or a repeating custom field that stores an ID reference.

#1069515

Thanks for explaining Christian. Will give the proxy method a try. Will I be able to have 2 authors if I do the proxy method mention above?

What ID reference needs to be stored in repeating custom field?

Is there any reference site for such membership by any chance?

#1069547

Will I be able to have 2 authors if I do the proxy method mention above?
No, you still can't have 2 authors for a single post, but you can connect multiple Member posts to the same Company using a one-to-many or many-to-many post relationship.

What ID reference needs to be stored in repeating custom field?
You can create a repeating custom field on the Company post that holds User IDs. Store the numeric ID of each User who should have access to that Company.

Is there any reference site for such membership by any chance?
No, we have a reference site for membership based on custom User Role. On your site that approach would require custom roles for each Company. That can be quite difficult to manage as content grows on your site.

#1069551

Thanks for clarifying Christian.

I guess I will have to drop the option and limit the edit right to just one user for now.