diff --git a/core/Field/Sidebar_Field.php b/core/Field/Sidebar_Field.php index bdcb8ba90..1a59c3f72 100644 --- a/core/Field/Sidebar_Field.php +++ b/core/Field/Sidebar_Field.php @@ -52,6 +52,12 @@ public function to_json( $load ) { $field_data = parent::to_json( $load ); + // override default value assigning behavior since sidebars are + // loaded separately and not as a part of the field options + $field_data = array_merge( $field_data, array( + 'value' => $this->get_formatted_value(), + ) ); + if ( ! empty( $this->excluded_sidebars ) ) { if ( ! is_array( $this->excluded_sidebars ) ) { $this->excluded_sidebars = array( $this->excluded_sidebars );