• Resolved fredhead

    (@fredhead)


    Hi,

    I have a question that may or may not be possible. There are great plugins to manage roles within WordPress. And I got one that works and does what I need. However, I’m trying as much as possible to use the functions.php file to minimize code and keep my site efficient.

    My question: Is there a set of WordPress functions that would let me not only create roles and capabilities (e.g. add_role, add_cap) but also assign categories to a specific role?

    Here’s how it would work. I’d create a role called Group A and categories called Cat 1, Cat 2, and Cat 3. The function would simply say Group A can read Cat 1 and Cat 2. If I assign a user to Group A, only content from Cat 1 and Cat 2 would be displayed to them. If I create a Group B, the same function could be used to say Group B can read Cat 2. And so on.

    Anyone know if this is possible within WordPress using functions.php?

Viewing 15 replies - 1 through 15 (of 15 total)
Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Restrict Reading by Category Using Functions.php?’ is closed to new replies.