Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#52709 closed defect (bug) (fixed)

get_block_wrapper_attributes checks for outdated __experimentalColor support

Reported by: noisysocks's profile noisysocks Owned by: noisysocks's profile noisysocks
Milestone: 5.7 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch commit dev-reviewed
Focuses: Cc:

Description

Copied from https://github.com/WordPress/gutenberg/issues/27670.

Describe the bug
Serverside rendered blocks with support for colors do not generate the appropriate classes if colors are set.

To reproduce
Steps to reproduce the behavior:

  1. Create any block with server side rendering, add support for color in its metadata.
  2. Use get_block_wrapper_attributes in the render callback.
  3. Check generated classes/styles

Expected behavior
Appropriate classes/styles should be generated.

Reason
wp_apply_colors_support checks for __experimentalColor instead of color when determining block support for color. See here: https://github.com/WordPress/WordPress/blob/master/wp-includes/block-supports/colors.php#L66
The classes get generated correctly if I add the __experimentalColor flag additonally in my block.json file.

"supports": {
  "color": true
}

Above does not work, below works.

"supports": {
  "color": true,
  "__experimentalColor": true
}

Editor version (please complete the following information):

  • WordPress version: 5.6
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? "default"
  • If the Gutenberg plugin is installed, which version is it? [e.g., 7.6]

Change History (7)

#2 @noisysocks
4 years ago

  • Keywords commit dev-feedback added

#3 @noisysocks
4 years ago

  • Keywords dev-reviewed added; dev-feedback removed

I'll commit this since I and @youknowriad have reviewed it.

noisysocks commented on PR #1068:


4 years ago
#4

Thanks @nosolosw!

#5 @noisysocks
4 years ago

In 50488:

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.

#6 @noisysocks
4 years ago

In 50489:

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.

#7 @noisysocks
4 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.