- standardize the condition for checking not editable fields to empty( $data['editable']

This commit is contained in:
Mykyta Synelnikov
2023-07-27 13:37:01 +03:00
parent 3f473806db
commit c9789b8462
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -3597,7 +3597,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
$class = 'um-icon-android-radio-button-off';
}
if ( isset( $data['editable'] ) && 0 === $data['editable'] ) {
if ( empty( $data['editable'] ) ) {
$col_class .= ' um-field-radio-state-disabled';
}
@@ -3716,7 +3716,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
$class = 'um-icon-android-checkbox-outline-blank';
}
if ( isset( $data['editable'] ) && 0 === $data['editable'] ) {
if ( empty( $data['editable'] ) ) {
$col_class .= ' um-field-radio-state-disabled';
}
+1 -1
View File
@@ -1663,7 +1663,7 @@ function um_can_edit_field( $data ) {
$can_edit = false;
} else {
if ( ! UM()->roles()->um_user_can( 'can_edit_everyone' ) ) {
if ( isset( $data['editable'] ) && $data['editable'] == 0 ) {
if ( empty( $data['editable'] ) ) {
$can_edit = false;
} else {
if ( ! um_is_user_himself() ) {