Created
July 12, 2013 10:24
-
-
Save jgalea/5983390 to your computer and use it in GitHub Desktop.
Check if a user has a capability or role.
This file contains 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 | |
// Checking for capability | |
if ( user_can( 6, 'read' ) ) { | |
// Do something | |
} | |
// Checking for role | |
if ( user_can( 6, 'administrator' ) ) { | |
// Do something | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment