mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 12:58:25 +01:00
Block Editor: A little cleanup to render_block()
. Always normalize $block['attrs']
to array in 'render_block'
filter.
See #45145. git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43888 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
781f30bf49
commit
c2aa32f654
@ -184,10 +184,13 @@ function render_block( $block ) {
|
||||
$block_content .= is_string( $chunk ) ? $chunk : render_block( $block['innerBlocks'][ $index++ ] );
|
||||
}
|
||||
|
||||
if ( ! is_array( $block['attrs'] ) ) {
|
||||
$block['attrs'] = array();
|
||||
}
|
||||
|
||||
if ( $is_dynamic ) {
|
||||
$attributes = is_array( $block['attrs'] ) ? (array) $block['attrs'] : array();
|
||||
$global_post = $post;
|
||||
$block_content = $block_type->render( $attributes, $block_content );
|
||||
$block_content = $block_type->render( $block['attrs'], $block_content );
|
||||
$post = $global_post;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user