mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
Fix community role field in profile edit screen
This commit is contained in:
+3
-2
@@ -57,7 +57,8 @@ class UM_User {
|
|||||||
function community_role_edit( $user ) {
|
function community_role_edit( $user ) {
|
||||||
global $ultimatemember;
|
global $ultimatemember;
|
||||||
if ( current_user_can( 'edit_users' ) && current_user_can( 'edit_user', $user->ID ) ) {
|
if ( current_user_can( 'edit_users' ) && current_user_can( 'edit_user', $user->ID ) ) {
|
||||||
um_fetch_user( $user->ID );
|
|
||||||
|
$um_user_role = get_user_meta($user->ID,'role',true);
|
||||||
?>
|
?>
|
||||||
<table class="form-table">
|
<table class="form-table">
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -68,7 +69,7 @@ class UM_User {
|
|||||||
<td>
|
<td>
|
||||||
<select name="um_role" id="um_role">
|
<select name="um_role" id="um_role">
|
||||||
<?php foreach( $ultimatemember->query->get_roles() as $key => $value ) { ?>
|
<?php foreach( $ultimatemember->query->get_roles() as $key => $value ) { ?>
|
||||||
<option value="<?php echo $key; ?>" <?php selected( um_user('role'), $key ); ?> ><?php echo $value; ?></option>
|
<option value="<?php echo $key; ?>" <?php selected( $um_user_role, $key ); ?> ><?php echo $value; ?></option>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
</select>
|
||||||
<span class="description"><?php _e( 'Assign or change the community role for this user', 'ultimatemember' ); ?></span>
|
<span class="description"><?php _e( 'Assign or change the community role for this user', 'ultimatemember' ); ?></span>
|
||||||
|
|||||||
Reference in New Issue
Block a user