I'm trying to do some capability checks on comment authors using the user_can() function, but for some reason it isn't working at all.

I have a custom capability setup with the Role Manager plugin called "read_citizen".

My check looks like this:

if(user_can($commentAuthor->user_id, 'read_citizen') {
   //do stuff here
}

I have confirmed that the $commentAuthor object is set correctly.

Ideas?

没有正确的解决方案

许可以下: CC-BY-SA归因
scroll top