Make WordPress Core


Ignore:
Timestamp:
10/26/2020 08:29:04 AM (4 years 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/src/wp-includes/blocks.php

    r49226 r49310  
    649649
    650650/**
    651  * Block currently being parsed.
    652  *
    653  * @type array
    654 */
    655 global $current_parsed_block;
    656 
    657 $current_parsed_block = array(
    658     'blockName'  => null,
    659     'attributes' => null,
    660 );
    661 
    662 /**
    663651 * Renders a single block into a HTML string.
    664652 *
    665653 * @since 5.0.0
    666654 *
    667  * @global array    $current_parsed_block Block currently being parsed.
    668655 * @global WP_Post  $post                 The post to edit.
    669656 * @global WP_Query $wp_query             WordPress Query object.
     
    674661 */
    675662function render_block( $parsed_block ) {
    676     global $post, $wp_query, $current_parsed_block;
     663    global $post, $wp_query;
    677664
    678665    /**
     
    688675        return $pre_render;
    689676    }
    690 
    691     $current_parsed_block = $parsed_block;
    692677
    693678    $source_block = $parsed_block;
Note: See TracChangeset for help on using the changeset viewer.