From c9789b8462e02c64685856e383ecbc7caa08938b Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Thu, 27 Jul 2023 13:37:01 +0300 Subject: [PATCH] - standardize the condition for checking not editable fields to `empty( $data['editable']` --- includes/core/class-fields.php | 4 ++-- includes/um-short-functions.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index c901eeec..6c3670f4 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -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'; } diff --git a/includes/um-short-functions.php b/includes/um-short-functions.php index 3ad24c9b..07f4b354 100644 --- a/includes/um-short-functions.php +++ b/includes/um-short-functions.php @@ -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() ) {