Skip Navigation

[Resolved] Edit Custom Fields from a different Post Type front-end

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

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
#556881

I'm creating a site that connects Individuals to Performing Arts Organizations. Actors/Directors/Choreographers etc. will create their own account and page with their content & Organizations will also have their own account and page.

I've set up many Post Types and Relationships within the system to link Individuals to the Organizations they are working with and also display their data (or custom fields) across these different post types. My question is: Is it possible to allow an organization to edit the data displayed on their page that is coming from a different user/post type without it editing the original content?

For example: Actor has his own account & page with a custom field "Bio" when cast in a show their "Bio" will appear on the Organizations page. I would like the Organization to be able to edit the Actor's "Bio" to adjust the original "Bio" to their needs. This needs to be done without changing the "Bio" on the Actors page.

#557044

The best way I can think of to incorporate this feature is to use multiple custom fields. One would hold the original information, and the other would hold the modified information. When an Actor creates their profile (I assume this creates a custom post type of Author) and includes the original bio information, you could automatically populate the alternate bio information with a clone of the original bio information. You would need to write some custom code for this. If you are using CRED to create posts, then the cred_save_data hook is going to be useful for you here.

More information about CRED hooks: https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

How you set this up depends on the relationship between Organizations and Actors. If Actors can belong to many Organizations, and Organizations contain many Actors, then a many-to-many relationship makes sense. In this case, you would probably store the alternate bio information in a custom field on your intermediary post type.

More information about many-to-many relationships: https://toolset.com/documentation/toolset-training-course/part-9-many-to-many-relationships-in-toolset/

If Actors can only belong to one Organization, you have a one-to-many relationship. In this case, you would probably store both bio fields in the Actor's custom post type. Only allow the Actors to modify the original value, and only allow the Organization to modify the alternate value.

Whenever the Actor modifies their bio in their profile, you could send an email notification to the Organization using CRED's email notification feature: https://toolset.com/documentation/user-guides/automated-email-notifications-with-cred/
This way the Organization would know that the original bio has changed, and they can modify the alternate bio if they would like.

The forum ‘Types Community Support’ is closed to new topics and replies.