diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php index 0315cd23cf..4f4ce16b0a 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php @@ -663,6 +663,7 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Controller { * Returns the given theme global styles variations. * * @since 6.0.0 + * @since 6.2.0 Returns parent theme variations, if they exist. * * @param WP_REST_Request $request The request instance. * @@ -679,9 +680,8 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Controller { } $variations = WP_Theme_JSON_Resolver::get_style_variations(); - $response = rest_ensure_response( $variations ); - return $response; + return rest_ensure_response( $variations ); } /** @@ -690,11 +690,12 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Controller { * Currently just checks for invalid markup. * * @since 6.2.0 + * @since 6.4.0 Changed method visibility to protected. * * @param string $css CSS to validate. * @return true|WP_Error True if the input was validated, otherwise WP_Error. */ - private function validate_custom_css( $css ) { + protected function validate_custom_css( $css ) { if ( preg_match( '#