- fixed editable attribute base on the legacy code;

- if `editable` attribute  doesn't exist then we set `editable` to true by default;
This commit is contained in:
Mykyta Synelnikov
2023-09-05 01:12:16 +03:00
parent 10467d12ce
commit e5b8ff400e
5 changed files with 20 additions and 9 deletions
+2 -1
View File
@@ -1065,7 +1065,8 @@ if ( ! class_exists( 'um\core\Form' ) ) {
if ( strstr( $field_key, 'role_' ) && array_key_exists( 'options', $field_settings ) && is_array( $field_settings['options'] ) ) {
if ( isset( $this->post_form['mode'] ) && 'profile' === $this->post_form['mode'] ) {
if ( empty( $field_settings['editable'] ) || ! um_can_edit_field( $field_settings ) ) {
// It's for a legacy case `array_key_exists( 'editable', $field_settings )`.
if ( ( array_key_exists( 'editable', $field_settings ) && empty( $field_settings['editable'] ) ) || ! um_can_edit_field( $field_settings ) ) {
continue;
}
}