- This topic has 4 replies, 2 voices, and was last updated 8 years, 7 months ago by
Marcus.
-
AuthorPosts
-
-
July 13, 2013 at 12:25 am #893
MarcusMemberHi all.
I was just wondering if anyone has used Piklist to create a custom taxonomy based on a users role. I know that currently there aren’t too many levels in worpdress’s roles but I want to create a new taxonomy and create my own custom roles (or realisitically user permissions).I am hoping someone has created a taxonomy based on the role (user permission) and if they don’t mind sharing a little bit of code to get me on the right track?
Also, has anyone had experience with creating new roles using piklist? (I haven’t seen anyone post about that) but I thought I’d ask.
Thanks
Marcus (8days after beta hint and still stoked) 🙂
-
July 14, 2013 at 9:15 pm #896
SteveKeymasterHow do you want to use User Roles and Taxonomies? Hide/show taxonomy based on user role?
-
July 14, 2013 at 9:43 pm #897
MarcusMemberHide/show taxonomy based on user role?
Exactly, based on current roles and potential future ones that I add.
Marcus
-
July 15, 2013 at 11:43 am #898
SteveKeymasterYou can use the standard WordPress function
current_user_can(), just wrap thepiklist_taxonomiesfilter in a conditional:if (current_user_can('edit_post')) { add_filter('piklist_taxonomies', 'your_taxonomy_function'); }This is untested but should work. If it doesn’t, then move the conditional into
your_taxonomy_function(). -
July 15, 2013 at 1:22 pm #902
MarcusMemberGreat Steve, that works for Roles and Capabilities.
Thanks.
Marcus
-
-
AuthorPosts
- You must be logged in to reply to this topic.