From 93de664de54b4eb5b8eb3d45b0962dabae549445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Wed, 9 Feb 2022 14:09:18 +0100 Subject: [PATCH] Use the classes defined by the plugin (#38663) --- .../class-wp-rest-global-styles-controller.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/compat/wordpress-5.9/class-wp-rest-global-styles-controller.php b/lib/compat/wordpress-5.9/class-wp-rest-global-styles-controller.php index 5e7be742b86db..e4171c7eb0872 100644 --- a/lib/compat/wordpress-5.9/class-wp-rest-global-styles-controller.php +++ b/lib/compat/wordpress-5.9/class-wp-rest-global-styles-controller.php @@ -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 ); } @@ -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. @@ -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 );