I'm looking for a way to code this:
<?php
if (user has admin privileges on this blog) {
echo 'Show something';
} else {
echo 'Show something different';
}
?>
Any ideas?
I'm looking for a way to code this:
<?php
if (user has admin privileges on this blog) {
echo 'Show something';
} else {
echo 'Show something different';
}
?>
Any ideas?
you mean like...
user_can('privilege')?
or is it allowedTo? I think it's the first. I've been buried in SMF code for the past month so it's all blending together in my head.
Not quite, more like: user has access to admin panel, perhaps:
user_role('admin')
I know one exists, I just don't know the correct term.
I think the call is is_admin.
edit: I can't find it right off though. Most of the checking is done with access levels. For example:
current_user_can('edit_users')
I'll try with something like that, I guess if they are able to edit users they must have access to the admin panel.
What would I actually write after:
<?php
if
Thanks
Edit: Sorry, just tried it out and works great. Thanks both!
current_user_can, user_can, bah... whatever. :D