Skip Navigation

[Closed] Automate Access Post Groups

This support ticket is created 4 years, 3 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 4 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#1716039

I have a custom post type called Departments and a custom post type called Services. I have joined them in a 1-2 many relationship (A department can have many services.)

Next I want to allow the director of each department to be able to edit their own department and related services content but no one elses department/services.

So I created a post group for each department and manually added the department and service posts to the post group then assigned the user who should be able to edit to each post group. So far so good. Then I suddenly realised what happens when the director creates a new service post? I would have to manually go in and add that new service post to the post group each time. So my question is, is there a way to automate this. I.e when a new service is created it is automatically added to the correct post group (I can't see how this would be achieved) and if not is there another way to approach this? Thanks!

#1716395

Hi, there's not a simple way to achieve this from wp-admin or from Forms, it will require a bit of custom code. The Access Group can be assigned by adding for the new post a postmeta value of "_wpcf_access_group" that contains the Access Group code. You'll have to find that existing value in the postmeta table of the database. Another ticket here in the forum includes an example and some explanation: https://toolset.com/forums/topic/how-to-use-cred-post-form-to-set-post-group-for-new-cpt-post/#post-572829

The topic ‘[Closed] Automate Access Post Groups’ is closed to new replies.