Make WordPress Core


Ignore:
Timestamp:
04/15/2021 02:41:38 PM (4 years ago)
Author:
gziolo
Message:

Editor: Update WordPress packages to use with WordPress 5.8

In the response to the discussion during the Dev Chat, I'm doing a first pass to keep WordPress packages up to date in the WordPress 5.8 release cycle.

See https://github.com/WordPress/wordpress-develop/pull/1176 for more details.

Props youknowriad, aristath, andraganescu.
See #52991.

File:
1 edited

Legend:

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

    r50488 r50761  
    44 *
    55 * @package WordPress
     6 * @since 5.6.0
    67 */
    78
     
    910 * Registers the style and colors block attributes for block types that support it.
    1011 *
     12 * @since 5.6.0
    1113 * @access private
    1214 *
     
    2123    $has_background_colors_support = true === $color_support || ( is_array( $color_support ) && _wp_array_get( $color_support, array( 'background' ), true ) );
    2224    $has_gradients_support         = _wp_array_get( $color_support, array( 'gradients' ), false );
     25    $has_link_colors_support       = _wp_array_get( $color_support, array( 'link' ), false );
     26    $has_color_support             = $has_text_colors_support ||
     27        $has_background_colors_support ||
     28        $has_gradients_support ||
     29        $has_link_colors_support;
    2330
    2431    if ( ! $block_type->attributes ) {
     
    2633    }
    2734
    28     if ( $has_text_colors_support && ! array_key_exists( 'style', $block_type->attributes ) ) {
     35    if ( $has_color_support && ! array_key_exists( 'style', $block_type->attributes ) ) {
    2936        $block_type->attributes['style'] = array(
    3037            'type' => 'object',
     
    5663 * This will be applied to the block markup in the front-end.
    5764 *
     65 * @since 5.6.0
    5866 * @access private
    5967 *
    6068 * @param  WP_Block_Type $block_type       Block type.
    61 * @param  array         $block_attributes Block attributes.
     69 * @param  array         $block_attributes Block attributes.
    6270 *
    6371 * @return array Colors CSS classes and inline styles.
    6472 */
    6573function wp_apply_colors_support( $block_type, $block_attributes ) {
    66     $color_support                 = _wp_array_get( $block_type->supports, array( 'color' ), false );
     74    $color_support = _wp_array_get( $block_type->supports, array( 'color' ), false );
     75
     76    if (
     77        is_array( $color_support ) &&
     78        array_key_exists( '__experimentalSkipSerialization', $color_support ) &&
     79        $color_support['__experimentalSkipSerialization']
     80    ) {
     81        return array();
     82    }
     83
    6784    $has_text_colors_support       = true === $color_support || ( is_array( $color_support ) && _wp_array_get( $color_support, array( 'text' ), true ) );
    6885    $has_background_colors_support = true === $color_support || ( is_array( $color_support ) && _wp_array_get( $color_support, array( 'background' ), true ) );
Note: See TracChangeset for help on using the changeset viewer.