[wp-trac] [WordPress Trac] #52709: get_block_wrapper_attributes checks for outdated __experimentalColor support

WordPress Trac noreply at wordpress.org
Wed Mar 3 23:20:03 UTC 2021


#52709: get_block_wrapper_attributes checks for outdated __experimentalColor
support
--------------------------+------------------------
 Reporter:  noisysocks    |      Owner:  noisysocks
     Type:  defect (bug)  |     Status:  assigned
 Priority:  normal        |  Milestone:  5.7
Component:  Editor        |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+------------------------
 ''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]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52709>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list