Skip to content

Commit

Permalink
Use the classes defined by the plugin (#38663)
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal authored Feb 9, 2022
1 parent e5f35bd commit 93de664
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ protected function prepare_item_for_database( $request ) {
$config['settings'] = $existing_config['settings'];
}
$config['isGlobalStylesUserThemeJSON'] = true;
$config['version'] = WP_Theme_JSON::LATEST_SCHEMA;
$config['version'] = WP_Theme_JSON_Gutenberg::LATEST_SCHEMA;
$changes->post_content = wp_json_encode( $config );
}

Expand Down Expand Up @@ -307,7 +307,7 @@ public function prepare_item_for_response( $post, $request ) { // phpcs:ignore V
$is_global_styles_user_theme_json = isset( $raw_config['isGlobalStylesUserThemeJSON'] ) && true === $raw_config['isGlobalStylesUserThemeJSON'];
$config = array();
if ( $is_global_styles_user_theme_json ) {
$config = ( new WP_Theme_JSON( $raw_config, 'custom' ) )->get_raw_data();
$config = ( new WP_Theme_JSON_Gutenberg( $raw_config, 'custom' ) )->get_raw_data();
}

// Base fields for every post.
Expand Down Expand Up @@ -555,7 +555,7 @@ public function get_theme_item( $request ) {
);
}

$theme = WP_Theme_JSON_Resolver::get_merged_data( 'theme' );
$theme = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data( 'theme' );
$data = array();
$fields = $this->get_fields_for_response( $request );

Expand Down

0 comments on commit 93de664

Please sign in to comment.