Make WordPress Core


Ignore:
Timestamp:
04/05/2022 12:06:48 PM (4 years ago)
Author:
gziolo
Message:

Editor: Backport block support changes from the Gutenberg plugin

Migrate spacing, border, color, dimensions, elements and typography and associated tests for block supports in the block editor.

Related changes in Gutenberg:

Props ramonopoly, aaronrobertshaw.
See #55505.

File:
1 edited

Legend:

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

    r52069 r53076  
    7676    if (
    7777        is_array( $color_support ) &&
    78         array_key_exists( '__experimentalSkipSerialization', $color_support ) &&
    79         $color_support['__experimentalSkipSerialization']
     78        wp_should_skip_block_supports_serialization( $block_type, 'color' )
    8079    ) {
    8180        return array();
     
    9089    // Text colors.
    9190    // Check support for text colors.
    92     if ( $has_text_colors_support ) {
     91    if ( $has_text_colors_support && ! wp_should_skip_block_supports_serialization( $block_type, 'color', 'text' ) ) {
    9392        $has_named_text_color  = array_key_exists( 'textColor', $block_attributes );
    9493        $has_custom_text_color = isset( $block_attributes['style']['color']['text'] );
     
    107106
    108107    // Background colors.
    109     if ( $has_background_colors_support ) {
     108    if ( $has_background_colors_support && ! wp_should_skip_block_supports_serialization( $block_type, 'color', 'background' ) ) {
    110109        $has_named_background_color  = array_key_exists( 'backgroundColor', $block_attributes );
    111110        $has_custom_background_color = isset( $block_attributes['style']['color']['background'] );
     
    124123
    125124    // Gradients.
    126     if ( $has_gradients_support ) {
     125    if ( $has_gradients_support && ! wp_should_skip_block_supports_serialization( $block_type, 'color', 'gradients' ) ) {
    127126        $has_named_gradient  = array_key_exists( 'gradient', $block_attributes );
    128127        $has_custom_gradient = isset( $block_attributes['style']['color']['gradient'] );
Note: See TracChangeset for help on using the changeset viewer.