From a29034a20803b6e6285b00c9da9da9e8b3611c50 Mon Sep 17 00:00:00 2001 From: ramon Date: Wed, 6 Sep 2023 14:39:27 +1000 Subject: [PATCH 1/2] Some minor tweaks from the following Gutenberg PRs: https://github.com/WordPress/gutenberg/pull/52819 https://github.com/WordPress/gutenberg/pull/53618 --- .../endpoints/class-wp-rest-global-styles-controller.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php index 0315cd23cf600..c306f841a74e2 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php @@ -663,6 +663,8 @@ public function get_theme_items_permissions_check( $request ) { // phpcs:ignore * Returns the given theme global styles variations. * * @since 6.0.0 + * @since 6.2.0 Returns parent theme variations, if they exist. + * @since 6.4.0 Removed unnecessary local variable. * * @param WP_REST_Request $request The request instance. * @@ -679,9 +681,8 @@ public function get_theme_items( $request ) { } $variations = WP_Theme_JSON_Resolver::get_style_variations(); - $response = rest_ensure_response( $variations ); - return $response; + return rest_ensure_response( $variations ); } /** @@ -690,11 +691,12 @@ public function get_theme_items( $request ) { * 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( '# Date: Wed, 6 Sep 2023 18:19:22 +1000 Subject: [PATCH 2/2] Removed non-functional comment --- .../endpoints/class-wp-rest-global-styles-controller.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php index c306f841a74e2..4f4ce16b0ab4d 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php @@ -664,7 +664,6 @@ public function get_theme_items_permissions_check( $request ) { // phpcs:ignore * * @since 6.0.0 * @since 6.2.0 Returns parent theme variations, if they exist. - * @since 6.4.0 Removed unnecessary local variable. * * @param WP_REST_Request $request The request instance. *