From 8d05380afc6cb176a413ea3a21ff575999f302f2 Mon Sep 17 00:00:00 2001 From: noisysocks Date: Wed, 3 Mar 2021 23:33:06 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/branches/5.7@50489 git-svn-id: http://core.svn.wordpress.org/branches/5.7@50102 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/block-supports/colors.php | 6 +++--- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/block-supports/colors.php b/wp-includes/block-supports/colors.php index f6e5a3cf93..296760ac59 100644 --- a/wp-includes/block-supports/colors.php +++ b/wp-includes/block-supports/colors.php @@ -15,7 +15,7 @@ function wp_register_colors_support( $block_type ) { $color_support = false; if ( property_exists( $block_type, 'supports' ) ) { - $color_support = _wp_array_get( $block_type->supports, array( '__experimentalColor' ), false ); + $color_support = _wp_array_get( $block_type->supports, array( 'color' ), false ); } $has_text_colors_support = true === $color_support || ( is_array( $color_support ) && _wp_array_get( $color_support, array( 'text' ), true ) ); $has_background_colors_support = true === $color_support || ( is_array( $color_support ) && _wp_array_get( $color_support, array( 'background' ), true ) ); @@ -63,10 +63,10 @@ function wp_register_colors_support( $block_type ) { * @return array Colors CSS classes and inline styles. */ function wp_apply_colors_support( $block_type, $block_attributes ) { - $color_support = _wp_array_get( $block_type->supports, array( '__experimentalColor' ), false ); + $color_support = _wp_array_get( $block_type->supports, array( 'color' ), false ); $has_text_colors_support = true === $color_support || ( is_array( $color_support ) && _wp_array_get( $color_support, array( 'text' ), true ) ); $has_background_colors_support = true === $color_support || ( is_array( $color_support ) && _wp_array_get( $color_support, array( 'background' ), true ) ); - $has_link_colors_support = _wp_array_get( $color_support, array( 'linkColor' ), false ); + $has_link_colors_support = _wp_array_get( $color_support, array( 'link' ), false ); $has_gradients_support = _wp_array_get( $color_support, array( 'gradients' ), false ); $classes = array(); $styles = array(); diff --git a/wp-includes/version.php b/wp-includes/version.php index dcf7db37ac..ce6bc60108 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.7-RC2-50482'; +$wp_version = '5.7-RC2-50489'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.