Change WordPress user roles and capabilities › Forums › How to or FAQ › Event category taxonomy not accessible, need to allow it to be selected
- This topic has 3 replies, 2 voices, and was last updated 3 months, 1 week ago by Andy Burns.
-
AuthorPosts
-
16/09/2024 at 18:42 #8721Andy BurnsParticipant
I am using the “Activate user access management to edit selected posts, pages, custom post types” to give specific users access to a custom post type data by using a “garden-assignments” taxonomy tag that extends events and garden CPT’s.
I grant the given ID for their garden assignment on their user profile “with category/taxonomy ID (comma separated)” and they can then see those gardens and events in the admin.
However, they are unable to assign an “event-category” taxonomy from the event organiser plugin. They do see the event category meta box, just no category options show in it.
I have debugged it to where it is the “Activate user access management to editing selected posts, pages, custom post types”. The only way to allow them to select the proper event category is to put the array of event-category id’s into the “post edit” option at the role level in the URE config. Of course, that negates the permissions setup and reason for using this module in the first place as it gives too much access to any event with those category.
Is there a config that I am missing or can you provide some code guidance via a filter that excludes event-category taxonomy from the URE’s consideration, specifically the functionality behind Activate user access management to editing selected posts, pages, custom post types? The goal is to allow anyone that can edit an event to assign an event-category taxonomy.
16/09/2024 at 20:23 #8722Andy BurnsParticipantSo the question is how can I use “with category/taxonomy ID (comma separated)” and exclude “event-category” taxonomy from that functionality?
17/09/2024 at 03:42 #8724VladimirKeymasterTry this filter ‘ure_post_edit_access_restricted_taxonomies’. For example, I excluded post tags from edit restrictions and restricted user can assign tags to the edited post inspite of those IDs, were not included into allowed categories/taxonomies list.
add_filter('ure_post_edit_access_restricted_taxonomies', 'not_restrict_tags', 10, 1); function not_restrict_tags( $taxonomies ) { foreach( $taxonomies as $key=>$taxonomy ) { if ( $taxonomy==='post_tag' ) { unset( $taxonomies[$key] ); } } return $taxonomies; }
17/09/2024 at 22:33 #8725Andy BurnsParticipantExcellent, this works perfectly. Thank you!
I didn’t see ‘ure_post_edit_access_restricted_taxonomies’ filter documented on https://www.role-editor.com/documentation/hooks/, can you add it?
-
AuthorPosts
- You must be logged in to reply to this topic.