diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d63b2a5..04f9ce71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/). +## [9.1.4] + +### Fixed +- Theme options settings are now saved as string and not as object. + ## [9.1.3] ### Fixed @@ -648,6 +653,7 @@ Init setup [Unreleased]: https://github.com/infinum/eightshift-libs/compare/main...HEAD +[9.1.4]: https://github.com/infinum/eightshift-libs/compare/9.1.3...9.1.4 [9.1.3]: https://github.com/infinum/eightshift-libs/compare/9.1.2...9.1.3 [9.1.2]: https://github.com/infinum/eightshift-libs/compare/9.1.1...9.1.2 [9.1.1]: https://github.com/infinum/eightshift-libs/compare/9.1.0...9.1.1 diff --git a/src/ThemeOptions/ThemeOptionsExample.php b/src/ThemeOptions/ThemeOptionsExample.php index 5a5b06d5..dd087225 100644 --- a/src/ThemeOptions/ThemeOptionsExample.php +++ b/src/ThemeOptions/ThemeOptionsExample.php @@ -43,35 +43,13 @@ public function register(): void */ public function addRbHfSettings(): void { - $default = [ - 'header' => null, - 'footer' => null, - ]; - - $schema = [ - 'type' => 'object', - 'properties' => [ - 'header' => [ - 'type' => 'string', - ], - 'footer' => [ - 'type' => 'string', - ], - 'fourOhFour' => [ - 'type' => 'string', - ], - ], - ]; - \register_setting( 'options', self::OPTION_NAME, [ - 'type' => 'object', - 'default' => $default, - 'show_in_rest' => [ - 'schema' => $schema, - ], + 'type' => 'string', + 'show_in_rest' => true, + 'default' => '{}', ] ); }