Role level of non-registered viewer?
-
I’m looking to implement a system in my plugin so that certain elements of the page are only seen by different levels of users. I’ve read the roles page and understand how to use that along with current_user_can, but one thing didn’t quite make sense to me: How do you designate non-registered users (i.e. anonymous web visitors)? In the list it appears that level 0 actually means normal registered users, not unregistered users, since it says level 0 can alter their profiles. So, using roles how can I have a test to allow anonymous users to see something?
Basically I want the regular page to be visible to anyone, an area that might say something to registered users, and then maybe a message to editors and admins. If I use the current_user_can it seems to me that anonymous users just won’t be able to see anything.
Hmmm, is it a case if the user is anonymous that current_user_can might be un-set? (as in not assigned any value at all? I wonder if this can be checked against in an isset statement to determine the anonymous status?)
- The topic ‘Role level of non-registered viewer?’ is closed to new replies.