Admin comments and user restrictions

I have set a bunch of roles within wordpress with the help of the “members” plugin.
But the capabilities regarding the comments moderation are very limited (“manage_others_comments” or not)

What I need to do is: “If my user is level1, only show the comments of category A,B,C, but if my user is level2, only show comments from category B,D,E”

Read More

I would need that for the “Admin dashboard”, for the “Admin post edit”, and, if possible, for the “admin search form”.

I’m struggling with the code to find where I can find the scripts making the related db queries in order to filter them by categories but I just can’t find them.

PS: I only need this feature for the Admin panel, no the front-end.

Any idea?

Related posts

Leave a Reply

1 comment

  1. Your question is actually pretty good, as you’ve found an edge case. The level (0-10) are still built into the roles system. So your custom role names collide with the built in capabilities. As role names get added as capability too, you should switch them to something more unique.

    Hint: Roles are a flat system. So an administrator could have more capabilities than a custom role of toilet cleaner, but when they don’t share a single capabiltiy, then the one doesn’t have more “power” than the other one. So don’t try to see them as scale from 0-10.