Have a website for local town municipality. Would like to restrict adding of new content to a CPT setup based on the category it is attached to as their are different departments that load documents on the site, but they should not be allowed to load information and link the post to another departments categories. They should only be able to load content in the categories they are assigned to post within.
How can this be done? Do I have to setup a form for each department from where they are able to post and only select specific categories?
Hello,
There isn't such kind of built-in feature within Toolset plugins, you might consider to setup different post forms for each department.
For example, in the those post forms, display a hidden generic field, setup different value for each form:
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_generic_field
After user submit the post form, use action hook cred_save_data to trigger a PHP function:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
In this PHP function, save the data into database:
https://developer.wordpress.org/reference/functions/wp_set_object_terms/
Is there a tutorial on using cred forms to create posts for CPT?
Please check our document:
https://toolset.com/course-lesson/front-end-forms-for-adding-content/
Front-end Forms for Adding Content in WordPress