| @@ -5,8 +5,12 @@ | ||
| 5 | 5 | * @package gutenberg |
| 6 | 6 | * @since 6.1.0 |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | +if ( class_exists( 'WP_Theme_JSON_Data_Gutenberg' ) ) { | |
| 10 | + return; | |
| 11 | +} | |
| 12 | + | |
| 9 | 13 | /** |
| 10 | 14 | * Class to provide access to update a theme.json structure. |
| 11 | 15 | */ |
| 12 | 16 | #[AllowDynamicProperties] |
| @@ -37,9 +41,9 @@ | ||
| 37 | 41 | * |
| 38 | 42 | * @param array $data Array following the theme.json specification. |
| 39 | 43 | * @param string $origin The origin of the data: default, theme, user. |
| 40 | 44 | */ |
| 41 | - public function __construct( $data = array( 'version' => WP_Theme_JSON_Gutenberg::LATEST_SCHEMA ), $origin = 'theme' ) { | |
| 45 | + public function __construct( $data = array(), $origin = 'theme' ) { | |
| 42 | 46 | $this->origin = $origin; |
| 43 | 47 | $this->theme_json = new WP_Theme_JSON_Gutenberg( $data, $this->origin ); |
| 44 | 48 | } |
| 45 | 49 | |
| @@ -66,17 +70,6 @@ | ||
| 66 | 70 | * @return array |
| 67 | 71 | */ |
| 68 | 72 | public function get_data() { |
| 69 | 73 | return $this->theme_json->get_raw_data(); |
| 70 | - } | |
| 71 | - | |
| 72 | - /** | |
| 73 | - * Return theme JSON object. | |
| 74 | - * | |
| 75 | - * @since 18.5.0 | |
| 76 | - * | |
| 77 | - * @return WP_Theme_JSON | |
| 78 | - */ | |
| 79 | - public function get_theme_json() { | |
| 80 | - return $this->theme_json; | |
| 81 | 74 | } |
| 82 | 75 | } |