Display all user name

<?php
function get_role_names() {
global $wp_roles;
if ( ! isset( $wp_roles ) )
$wp_roles = new WP_Roles();
return $wp_roles->get_names();
}echo ‘<pre>’; print_r(get_role_names());
?>

===========================================

<p>
<?php
function get_role_names() {
global $wp_roles;
if ( ! isset( $wp_roles ) )
$wp_roles = new WP_Roles();
return $wp_roles->get_names();
}
$userrole=array();
$userrole = get_role_names();
?> <select>
<?php foreach($userrole as $userroles=> $userval)
{
?> <option value=”<?php echo $userroles; ?>”><?php echo $userval; ?></option><?php
}
?>
</select>
</p>

Advertisements

Tagged:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: