- fixed roles fields;

This commit is contained in:
nikitozzzzzzz
2018-06-18 15:40:30 +03:00
parent b7f075843d
commit e66e595ba9
2 changed files with 3 additions and 6 deletions
+2 -5
View File
@@ -2610,6 +2610,8 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
$options_pair = true;
}
$options = $this->get_available_roles( $form_key, $options );
// add options
if ( ! empty( $options ) ) {
foreach ( $options as $k => $v ) {
@@ -2929,11 +2931,6 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
$col_class = '';
}
if ( $form_key == 'role' ) {
$option_value = strtolower( str_replace( ' ', '-', $option_value ) );
$option_value = in_array( $option_value, get_option( 'um_roles' ) ) ? 'um_' . $option_value : $option_value;
}
if ($this->is_radio_checked( $key, $option_value, $data )) {
$active = 'active';
$class = "um-icon-android-radio-button-on";
+1 -1
View File
@@ -1661,7 +1661,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
if ( ! in_array( $key, $this->update_user_keys ) ) {
update_user_meta( $this->id, $key, $value );
} else {
$args[$key] = esc_attr( $changes['role_radio'] );
$args[ $key ] = esc_attr( $changes[ $key ] );
}
}