WordPress.org

Make WordPress Core

Changeset 43888


Ignore:
Timestamp:
11/12/2018 10:02:25 AM (12 months ago)
Author:
azaozz
Message:

Block Editor: A little cleanup to render_block(). Always normalize $block['attrs'] to array in 'render_block' filter.

See #45145.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-includes/blocks.php

    r43884 r43888  
    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    }
Note: See TracChangeset for help on using the changeset viewer.