Skip to content

Commit

Permalink
Update default schema elsewhere
Browse files Browse the repository at this point in the history
  • Loading branch information
ajlende committed Feb 7, 2024
1 parent e13b8a3 commit 661f0c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/class-wp-theme-json-data-gutenberg.php
Expand Up @@ -38,7 +38,7 @@ class WP_Theme_JSON_Data_Gutenberg {
* @param array $data Array following the theme.json specification.
* @param string $origin The origin of the data: default, theme, user.
*/
public function __construct( $data = array(), $origin = 'theme' ) {
public function __construct( $data = array( 'version' => WP_Theme_JSON_Gutenberg::LATEST_SCHEMA ), $origin = 'theme' ) {
$this->origin = $origin;
$this->theme_json = new WP_Theme_JSON_Gutenberg( $data, $this->origin );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/class-wp-theme-json-gutenberg.php
Expand Up @@ -692,7 +692,7 @@ public static function get_element_class_name( $element ) {
* @param string $origin Optional. What source of data this object represents.
* One of 'default', 'theme', or 'custom'. Default 'theme'.
*/
public function __construct( $theme_json = array(), $origin = 'theme' ) {
public function __construct( $theme_json = array( 'version' => WP_Theme_JSON_Gutenberg::LATEST_SCHEMA ), $origin = 'theme' ) {
if ( ! in_array( $origin, static::VALID_ORIGINS, true ) ) {
$origin = 'theme';
}
Expand Down
2 changes: 1 addition & 1 deletion lib/class-wp-theme-json-resolver-gutenberg.php
Expand Up @@ -369,7 +369,7 @@ public static function get_block_data() {
return static::$blocks;
}

$config = array( 'version' => 2 );
$config = array( 'version' => WP_Theme_JSON_Gutenberg::LATEST_SCHEMA );
foreach ( $blocks as $block_name => $block_type ) {
if ( isset( $block_type->supports['__experimentalStyle'] ) ) {
$config['styles']['blocks'][ $block_name ] = static::remove_json_comments( $block_type->supports['__experimentalStyle'] );
Expand Down

0 comments on commit 661f0c0

Please sign in to comment.