Make WordPress Core


Ignore:
Timestamp:
05/21/2021 10:12:42 AM (5 years ago)
Author:
youknowriad
Message:

Block Editor: Updated the WordPress packages from Gutenberg 10.7.0 RC.

This also includes:

  • The removal of the Post Author block.
  • Renaming build_query_vars_from_query_block function.
  • Update the block supports.

Props gziolo.
See #52991.
-This line, and those below, will be ignored--

M package-lock.json
M package.json
M src/wp-includes/assets/script-loader-packages.php
M src/wp-includes/block-supports/colors.php
AM src/wp-includes/block-supports/elements.php
D src/wp-includes/block-supports/padding.php
AM src/wp-includes/block-supports/spacing.php
M src/wp-includes/block-supports/typography.php
M src/wp-includes/blocks/column/block.json
M src/wp-includes/blocks/index.php
D src/wp-includes/blocks/post-author
D src/wp-includes/blocks/post-author.php
M src/wp-includes/blocks/post-content.php
M src/wp-includes/blocks/post-featured-image.php
M src/wp-includes/blocks/query/block.json
M src/wp-includes/blocks/query-loop/block.json
M src/wp-includes/blocks/query-loop.php
M src/wp-includes/blocks/query-pagination/block.json
M src/wp-includes/blocks/query-pagination-next.php
M src/wp-includes/blocks/query-pagination-numbers.php
M src/wp-includes/blocks/site-tagline/block.json
M src/wp-includes/blocks/site-title/block.json
M src/wp-includes/blocks.php
M src/wp-settings.php
M tests/phpunit/tests/blocks/block.php
M tools/webpack/packages.js

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-supports/typography.php

    r50929 r50945  
    6969        }
    7070
    71         $classes = array();
    72         $styles  = array();
     71        $attributes = array();
     72        $classes    = array();
     73        $styles     = array();
    7374
    7475        $has_font_family_support     = _wp_array_get( $block_type->supports, array( '__experimentalFontFamily' ), false );
    … …  
    8283        $skip_font_size_support_serialization = _wp_array_get( $block_type->supports, array( '__experimentalSkipFontSizeSerialization' ), false );
    8384
     85        // Covers all typography features _except_ font size.
     86        $skip_typography_serialization = _wp_array_get( $block_type->supports, array( '__experimentalSkipTypographySerialization' ), false );
     87
    8488        // Font Size.
    8589        if ( $has_font_size_support && ! $skip_font_size_support_serialization ) {
    … …  
    96100
    97101        // Font Family.
    98         if ( $has_font_family_support ) {
     102        if ( $has_font_family_support && ! $skip_typography_serialization ) {
    99103                $has_font_family = isset( $block_attributes['style']['typography']['fontFamily'] );
    100104                // Apply required class and style.
    … …  
    107111                                $styles[]         = sprintf( 'font-family: var(--wp--preset--font-family--%s);', $font_family_name );
    108112                        } else {
    109                                 $styles[] = sprintf( 'font-family: %s;', $block_attributes['style']['color']['fontFamily'] );
     113                                $styles[] = sprintf( 'font-family: %s;', $block_attributes['style']['typography']['fontFamily'] );
    110114                        }
    111115                }
    … …  
    113117
    114118        // Font style.
    115         if ( $has_font_style_support ) {
     119        if ( $has_font_style_support && ! $skip_typography_serialization ) {
    116120                // Apply font style.
    117121                $font_style = wp_typography_get_css_variable_inline_style( $block_attributes, 'fontStyle', 'font-style' );
    … …  
    122126
    123127        // Font weight.
    124         if ( $has_font_weight_support ) {
     128        if ( $has_font_weight_support && ! $skip_typography_serialization ) {
    125129                // Apply font weight.
    126130                $font_weight = wp_typography_get_css_variable_inline_style( $block_attributes, 'fontWeight', 'font-weight' );
    … …  
    131135
    132136        // Line Height.
    133         if ( $has_line_height_support ) {
     137        if ( $has_line_height_support && ! $skip_typography_serialization ) {
    134138                $has_line_height = isset( $block_attributes['style']['typography']['lineHeight'] );
    135139                // Add the style (no classes for line-height).
    … …  
    140144
    141145        // Text Decoration.
    142         if ( $has_text_decoration_support ) {
     146        if ( $has_text_decoration_support && ! $skip_typography_serialization ) {
    143147                $text_decoration_style = wp_typography_get_css_variable_inline_style( $block_attributes, 'textDecoration', 'text-decoration' );
    144148                if ( $text_decoration_style ) {
    … …  
    148152
    149153        // Text Transform.
    150         if ( $has_text_transform_support ) {
     154        if ( $has_text_transform_support && ! $skip_typography_serialization ) {
    151155                $text_transform_style = wp_typography_get_css_variable_inline_style( $block_attributes, 'textTransform', 'text-transform' );
    152156                if ( $text_transform_style ) {
    … …  
    155159        }
    156160
    157         $attributes = array();
    158161        if ( ! empty( $classes ) ) {
    159162                $attributes['class'] = implode( ' ', $classes );
Note: See TracChangeset for help on using the changeset viewer.