<?php
_e( 'Username'
); ?></label></th>
<td><input type="text" name="user_login" id="user_login" value="<?php
echo esc_attr( $profile_user->user_login
); ?>" disabled="disabled" class="regular-text" /> <span class="description"><?php
_e( 'Usernames cannot be changed.'
); ?></span></td>
</tr>
<?php
if ( ! IS_PROFILE_PAGE && !
is_network_admin() &&
current_user_can( 'promote_user',
$profile_user->ID
) ) : ?>
<tr class="user-role-wrap">
<th><label for="role"><?php
_e( 'Role'
); ?></label></th>
<td>
<select name="role" id="role">
<?php
// Compare user role against currently editable roles.
$user_roles =
array_intersect( array_values( $profile_user->roles
),
array_keys( get_editable_roles() ) );
$user_role =
reset( $user_roles );
// Print the full list of roles with the primary one selected.
wp_dropdown_roles( $user_role );
// Print the 'no role' option. Make it selected if the user has no role yet.
if ( $user_role ) { echo '<option value="">' .
__( '— No role for this site —'
) . '</option>';
} else { echo '<option value="" selected="selected">' .
__( '— No role for this site —'
) . '</option>';
}