Make WordPress Core


Ignore:
Timestamp:
10/26/2020 08:29:04 AM (15 months ago)
Author:
youknowriad
Message:

Block Editor: Fix WP_Block_Supports class compatibility with Gutenberg-provided class.

When using WordPress trunk with Gutenberg master, there's an incompatibility causing
the dynamic block generated classes to be omitted.
This commit refactors the block supports to fix that problem.

Props nosolosw.
Fixes #51606.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/testcase-block-supports.php

    r49226 r49310  
    9797     *
    9898     * @param array $block Block to render.
     99     *
     100     * @return string Rendered output for the current block.
    99101     */
    100102    private function render_example_block( $block ) {
    101         global $current_parsed_block;
    102         $current_parsed_block = $block;
    103         $wrapper_attributes   = get_block_wrapper_attributes(
     103        WP_Block_Supports::init();
     104        WP_Block_Supports::$block_to_render = $block;
     105        $wrapper_attributes                 = get_block_wrapper_attributes(
    104106            array(
    105107                'class' => 'foo-bar-class',
Note: See TracChangeset for help on using the changeset viewer.