- fixed issue with not editable fields and their visibility;

This commit is contained in:
nikitasinelnikov
2020-01-29 15:53:39 +02:00
parent f7bbafda7b
commit c8a847f2d3
2 changed files with 11 additions and 5 deletions
+8 -4
View File
@@ -1936,10 +1936,6 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
return '';
}
if ( ! um_can_edit_field( $data ) ) {
return '';
}
um_fetch_user( $_um_profile_id );
// Stop return empty values build field attributes:
@@ -1960,6 +1956,14 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
}
}
if ( ! empty( $this->editing ) && $this->set_mode == 'profile' ) {
if ( ! UM()->roles()->um_user_can( 'can_edit_everyone' ) ) {
if ( isset( $data['editable'] ) && $data['editable'] == 0 ) {
$disabled = ' disabled="disabled" ';
}
}
}
$disabled = apply_filters( 'um_is_field_disabled', $disabled, $data );
if ( ! isset( $data['autocomplete'] ) ) {