Welcome Visitor plugin fails userlevel test
-
Installed the welcome-visitor plugin. When I go to options->Welcome I get an error msg indicating not authorized. I found on the plugin blog some fix to the code. The fix says to remove the following check:
global $user_level;
if ($user_level < 8)
die($no_access_msg);$user_level is null. To fix, I could comment out but I’d rather convert it to the new capabilities/roles.
So how do I check for admin authority? I’ve been reviewing the capabilities.php file and am just not very familiar with the oops nomenclature. I tried this: $role = get_role(‘administrator’); but can’t seem to reference the var? An associative array is returned? When I echo I get resource #3 so I know I’m not referencing it properly.
All I need is a couple lines of code to determine whether user is admin… Thanks to all.
- The topic ‘Welcome Visitor plugin fails userlevel test’ is closed to new replies.