Make WordPress Core

Ticket #45145: 45145-blocks.php.diff

File 45145-blocks.php.diff, 732 bytes (added by azaozz, 3 years ago)
  • src/wp-includes/blocks.php

     
    184184                $block_content .= is_string( $chunk ) ? $chunk : render_block( $block['innerBlocks'][ $index++ ] );
    185185        }
    186186
     187        if ( ! is_array( $block['attrs'] ) ) {
     188                $block['attrs'] = array();
     189        }
     190
    187191        if ( $is_dynamic ) {
    188                 $attributes    = is_array( $block['attrs'] ) ? (array) $block['attrs'] : array();
    189192                $global_post   = $post;
    190                 $block_content = $block_type->render( $attributes, $block_content );
     193                $block_content = $block_type->render( $block['attrs'], $block_content );
    191194                $post          = $global_post;
    192195        }
    193196