Hi, I have created a custom post type with a custom taxonomy. I want to create a new role that can only modify those post types based on a taxonomy.
For ex.:
Custom post type "House"
Custom Taxonomy "Client 1"
Custom Role "Client 1"
I want every user that have the role Client 1 to be able to modify just the post types that have the taxonomy Client 1.
Any idea on how to do that?
Thanks!
Hi Ernesto,
Thank you for contacting us and I'll be happy to assist.
There is no direct way to link custom taxonomy terms and custom user roles, but to achieve this you'll need some custom code.
For example, you can create a custom shortcode ( ref: https://codex.wordpress.org/Shortcode_API ) which gets the current user's role and the current post's attached taxonomy terms and then return true or false, whether they match or not.
That custom shortcode can then be used with Toolset View's conditional blocks, to show/hide the post's content or edit form, accordingly:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-shortcodes-in-conditions/
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar