diff --git a/docs/reference-guides/theme-json-reference/theme-json-living.md b/docs/reference-guides/theme-json-reference/theme-json-living.md index ac2d059a1aa0f7..c5585f552c7934 100644 --- a/docs/reference-guides/theme-json-reference/theme-json-living.md +++ b/docs/reference-guides/theme-json-reference/theme-json-living.md @@ -91,6 +91,7 @@ Settings related to typography. | letterSpacing | boolean | true | | | lineHeight | boolean | false | | | textDecoration | boolean | true | | +| writingMode | boolean | true | | | textTransform | boolean | true | | | dropCap | boolean | true | | | fontSizes | array | | name, size, slug | @@ -157,6 +158,7 @@ Typography styles. | letterSpacing | string | | | lineHeight | string | | | textDecoration | string | | +| writingMode | string | | | textTransform | string | | --- diff --git a/lib/compat/wordpress-6.0/class-gutenberg-rest-global-styles-controller.php b/lib/compat/wordpress-6.0/class-gutenberg-rest-global-styles-controller.php index 94f9f85d53b452..1e6600cf2f8e9d 100644 --- a/lib/compat/wordpress-6.0/class-gutenberg-rest-global-styles-controller.php +++ b/lib/compat/wordpress-6.0/class-gutenberg-rest-global-styles-controller.php @@ -46,45 +46,45 @@ public function register_routes() { * @param WP_REST_Request $request The request instance. * @return WP_REST_Response|WP_Error */ - public function get_theme_item( $request ) { - if ( wp_get_theme()->get_stylesheet() !== $request['stylesheet'] ) { - // This endpoint only supports the active theme for now. - return new WP_Error( - 'rest_theme_not_found', - __( 'Theme not found.', 'gutenberg' ), - array( 'status' => 404 ) - ); - } + public function get_theme_item( $request ) { + if ( wp_get_theme()->get_stylesheet() !== $request['stylesheet'] ) { + // This endpoint only supports the active theme for now. + return new WP_Error( + 'rest_theme_not_found', + __( 'Theme not found.', 'gutenberg' ), + array( 'status' => 404 ) + ); + } - $theme = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data( 'theme' ); - $data = array(); - $fields = $this->get_fields_for_response( $request ); + $theme = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data( 'theme' ); + $data = array(); + $fields = $this->get_fields_for_response( $request ); - if ( rest_is_field_included( 'settings', $fields ) ) { - $data['settings'] = $theme->get_settings(); - } + if ( rest_is_field_included( 'settings', $fields ) ) { + $data['settings'] = $theme->get_settings(); + } - if ( rest_is_field_included( 'styles', $fields ) ) { - $raw_data = $theme->get_raw_data(); - $data['styles'] = isset( $raw_data['styles'] ) ? $raw_data['styles'] : array(); - } + if ( rest_is_field_included( 'styles', $fields ) ) { + $raw_data = $theme->get_raw_data(); + $data['styles'] = isset( $raw_data['styles'] ) ? $raw_data['styles'] : array(); + } - $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; - $data = $this->add_additional_fields_to_object( $data, $request ); - $data = $this->filter_response_by_context( $data, $context ); + $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; + $data = $this->add_additional_fields_to_object( $data, $request ); + $data = $this->filter_response_by_context( $data, $context ); - $response = rest_ensure_response( $data ); + $response = rest_ensure_response( $data ); - $links = array( - 'self' => array( - 'href' => rest_url( sprintf( '%s/%s/themes/%s', $this->namespace, $this->rest_base, $request['stylesheet'] ) ), - ), - ); + $links = array( + 'self' => array( + 'href' => rest_url( sprintf( '%s/%s/themes/%s', $this->namespace, $this->rest_base, $request['stylesheet'] ) ), + ), + ); - $response->add_links( $links ); + $response->add_links( $links ); - return $response; - } + return $response; + } /** * Checks if a given request has access to read a single theme global styles config.