Tagged: ,

Viewing 4 reply threads
  • Author
    Posts
    • #893
      Marcus
      Member

      Hi 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) 🙂

    • #896
      Steve
      Keymaster

      How do you want to use User Roles and Taxonomies? Hide/show taxonomy based on user role?

    • #897
      Marcus
      Member

      Hide/show taxonomy based on user role?

      Exactly, based on current roles and potential future ones that I add.

      Marcus

    • #898
      Steve
      Keymaster

      You can use the standard WordPress function current_user_can(), just wrap the piklist_taxonomies filter 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().

    • #902
      Marcus
      Member

      Great Steve, that works for Roles and Capabilities.

      Thanks.

      Marcus

Viewing 4 reply threads
  • You must be logged in to reply to this topic.