From 6d5b496cf5e58366cc5da1d3283ad62dfae0b6d9 Mon Sep 17 00:00:00 2001 From: Justin Sternberg Date: Thu, 27 Apr 2017 20:56:46 -0400 Subject: [PATCH] add `save_field` flag to readonly/disabled field. --- modified-field-types/readonly-field-type.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modified-field-types/readonly-field-type.php b/modified-field-types/readonly-field-type.php index e8102bb..5b9dbe6 100644 --- a/modified-field-types/readonly-field-type.php +++ b/modified-field-types/readonly-field-type.php @@ -11,6 +11,7 @@ 'description' => 'The value of this input should be saved somewhere else.', 'id' => '_jtcmb2_readonly', 'type' => 'text', + 'save_field' => false, // Otherwise CMB2 will end up remove the value. 'attributes' => array( 'readonly' => 'readonly', 'disabled' => 'disabled',