mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@49310 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -647,24 +647,11 @@ function _excerpt_render_inner_columns_blocks( $columns, $allowed_blocks ) {
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Block currently being parsed.
|
||||
*
|
||||
* @type array
|
||||
*/
|
||||
global $current_parsed_block;
|
||||
|
||||
$current_parsed_block = array(
|
||||
'blockName' => null,
|
||||
'attributes' => null,
|
||||
);
|
||||
|
||||
/**
|
||||
* Renders a single block into a HTML string.
|
||||
*
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @global array $current_parsed_block Block currently being parsed.
|
||||
* @global WP_Post $post The post to edit.
|
||||
* @global WP_Query $wp_query WordPress Query object.
|
||||
* @global WP_Query $wp_query WordPress Query object.
|
||||
@@ -673,7 +660,7 @@ $current_parsed_block = array(
|
||||
* @return string String of rendered HTML.
|
||||
*/
|
||||
function render_block( $parsed_block ) {
|
||||
global $post, $wp_query, $current_parsed_block;
|
||||
global $post, $wp_query;
|
||||
|
||||
/**
|
||||
* Allows render_block() to be short-circuited, by returning a non-null value.
|
||||
@@ -688,8 +675,6 @@ function render_block( $parsed_block ) {
|
||||
return $pre_render;
|
||||
}
|
||||
|
||||
$current_parsed_block = $parsed_block;
|
||||
|
||||
$source_block = $parsed_block;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user