Created
September 25, 2013 02:41
-
-
Save BeardedGinger/6694524 to your computer and use it in GitHub Desktop.
Get available WordPress user roles as checkboxes
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 | |
global $wp_roles; | |
if ( ! isset( $wp_roles ) ) | |
$wp_roles = new WP_Roles(); | |
$roles = $wp_roles->get_names(); | |
foreach ($roles as $role_value => $role_name) { | |
echo '<p><input type="checkbox" value="' . $role_value . '">'.$role_name.'</p>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Confusing indentation.