Skip to content

Instantly share code, notes, and snippets.

@daronspence
Created March 25, 2015 03:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daronspence/819c002f998bb92bfcb5 to your computer and use it in GitHub Desktop.
Save daronspence/819c002f998bb92bfcb5 to your computer and use it in GitHub Desktop.
add_action('init', function(){
global $wp_roles;
$roles = $wp_roles->roles;
$choices = array();
foreach ( $roles as $key => $value ){
if ( $key !== 'administrator')
continue;
$caps = $value['capabilities'];
foreach ( $caps as $cap_key => $cap_value )
$choices[] = $cap_key;
}
var_dump($choices);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment