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 | Owned by: | 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:
- Create any block with server side rendering, add support for color in its metadata.
- Use
get_block_wrapper_attributes
in the render callback. - 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)
This ticket was mentioned in PR #1068 on WordPress/wordpress-develop by nosolosw.
4 years ago
#1
- Keywords has-patch added
#3
@
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!
Fixes https://github.com/WordPress/gutenberg/issues/27670 (see the issue for details)
Props to https://github.com/rafhun
https://core.trac.wordpress.org/ticket/52709