Make WordPress Core

Changeset 50488


Ignore:
Timestamp:
03/03/2021 11:29:48 PM (4 years ago)
Author:
noisysocks
Message:

Block Editor: Fix color support for dynamic blocks

Changes wp_apply_colors_support to check for for color instead of
experimentalColor when determining block support for color.

Props nosolosw, rafhun, youknowriad.
See #52709.

File:
1 edited

Legend:

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

    r49580 r50488  
    1616    $color_support = false;
    1717    if ( property_exists( $block_type, 'supports' ) ) {
    18         $color_support = _wp_array_get( $block_type->supports, array( '__experimentalColor' ), false );
     18        $color_support = _wp_array_get( $block_type->supports, array( 'color' ), false );
    1919    }
    2020    $has_text_colors_support       = true === $color_support || ( is_array( $color_support ) && _wp_array_get( $color_support, array( 'text' ), true ) );
     
    6464 */
    6565function wp_apply_colors_support( $block_type, $block_attributes ) {
    66     $color_support                 = _wp_array_get( $block_type->supports, array( '__experimentalColor' ), false );
     66    $color_support                 = _wp_array_get( $block_type->supports, array( 'color' ), false );
    6767    $has_text_colors_support       = true === $color_support || ( is_array( $color_support ) && _wp_array_get( $color_support, array( 'text' ), true ) );
    6868    $has_background_colors_support = true === $color_support || ( is_array( $color_support ) && _wp_array_get( $color_support, array( 'background' ), true ) );
    69     $has_link_colors_support       = _wp_array_get( $color_support, array( 'linkColor' ), false );
     69    $has_link_colors_support       = _wp_array_get( $color_support, array( 'link' ), false );
    7070    $has_gradients_support         = _wp_array_get( $color_support, array( 'gradients' ), false );
    7171    $classes                       = array();
Note: See TracChangeset for help on using the changeset viewer.