How to check if user is an admin in wordpress

The best way so far to check whether the current user is a super admin user with full permissions in wordpress is to use current_user_can function and check for manage_options . If user has manage_options they clearly have full permissions. I use this for example to hide ads from me and to hide google analytics so that it doesn’t count me while I’m logged in as admin.

google analytics code goes here

Leave a Reply

Your email address will not be published.

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.