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"

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?

  • Since when do comments have "categories"? Btw: User "levels" are deprecated since 2.x - use the other capabilities instead (namely: role names). – kaiser Oct 24 '12 at 1:19
  • 1
    A comment is related to a post and a post to a category so yes, comments have categories. These are remotely related within the database as you can find the category of a comment and all comments from a category. And regarding the "levels", I'm not using any deprecated level. "level1" and "level2" are names I gave to the roles not capabilities of roles. So I don't know exactly what's wrong with my question as you seem to suggest. Thank you for your upcoming help regarding my question. And sorry for the misunderstanding, I hope I made myself clear this time. – Baylock Oct 24 '12 at 3:49
  • 1
    Yes, you have. Your question is actually pretty good, as you've also found an edge case. +1 for comment and question (Hint: Edit your question with that info - not everybody who drives by reads comments). – kaiser Oct 24 '12 at 10:56

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.

  • This is an unfortunate choice of terms I used. My real role names are different from these and are very "business" oriented so I decided to illustrate theses roles by level terms in here but I pretty well know wordpress roles are organized in a horitontal fashion. I use a plugin called "Members" and you can add or susbtract any capibility to any roles so that you could end u with a "levelone" role with less capabilities than "leveltwo". As you can see with my example of categories dispatching, there are equal in power, just different as they manage different categories. That was my only point. – Baylock Oct 24 '12 at 14:58
  • 1
    No. WordPress roles are not organized horizontal. If you attach one capability or role, it doesn't mean that there're other ones that need to be attached/assigned. And a reminder for future questions: If you are aware of "collisions" (e.g. levelX), then please don't use them to illustrate your problem. And please head back to yourquestion, edit it and make the things clear that have not been so far. – kaiser Oct 24 '12 at 15:14
  • 1
    @Baylock Glad to hear that you're understanding that. Please remove the checkmark from my answer (upvoting still appreciated). If you then update your question or rework the text, you'll push it to page one again and let it gain some more traction. And as I said: People here work actively to get answers to old questions too. – kaiser Jan 22 '13 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.