Created
June 25, 2019 13:58
-
-
Save someguy9/6f8dec3b40bbc196f6adce47c61e7a19 to your computer and use it in GitHub Desktop.
Check if a user is an admin in WordPress.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if( current_user_can('administrator') ) { | |
echo 'This will display for WordPress admins only.'; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment