From 8cb6c79c268bcd03c7f4d89228150afae35dbef4 Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Tue, 22 Aug 2023 17:17:40 +0300 Subject: [PATCH] - fixed "Can user edit this field?" option. It changed to the bool type with true|false values only. Field can be editable only in the case if 'editable'===true --- includes/admin/core/class-admin-metabox.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/includes/admin/core/class-admin-metabox.php b/includes/admin/core/class-admin-metabox.php index 4e35a663..d1dc81b8 100644 --- a/includes/admin/core/class-admin-metabox.php +++ b/includes/admin/core/class-admin-metabox.php @@ -2378,15 +2378,21 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) { break; case '_editable': + // Make a new field editable by default. + if ( false === $this->in_edit ) { + $this->edit_mode_value = true; + } + + if ( empty( $this->edit_mode_value ) ) { + $this->edit_mode_value = false; + } ?>
- -

+

- edit_mode_value || $this->edit_mode_value ) ?> /> + edit_mode_value ); ?> />

-