Created
May 23, 2019 15:51
-
-
Save nfsarmento/029558ebcf0baa3a7f734a225ad1d8af to your computer and use it in GitHub Desktop.
List All Capabilities of Current User in WordPress
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
$data = get_userdata( get_current_user_id() ); | |
if ( is_object( $data) ) { | |
$current_user_caps = $data->allcaps; | |
// print it to the screen | |
echo '<pre>' . print_r( $current_user_caps, true ) . '</pre>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment