diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php
index e8647bf526..e22c72d220 100644
|
a
|
b
|
function render_block( $block ) { |
| 260 | 260 | |
| 261 | 261 | if ( $is_dynamic ) { |
| 262 | 262 | $global_post = $post; |
| 263 | | $block_content = $block_type->render( $block['attrs'], $block_content ); |
| | 263 | $block_content = $block_type->render( $block['attrs'], $block_content, $block ); |
| 264 | 264 | $post = $global_post; |
| 265 | 265 | } |
| 266 | 266 | |
diff --git a/src/wp-includes/class-wp-block-type.php b/src/wp-includes/class-wp-block-type.php
index 6ffda95b4e..bdd5ff476c 100644
|
a
|
b
|
public function __construct( $block_type, $args = array() ) { |
| 97 | 97 | * |
| 98 | 98 | * @param array $attributes Optional. Block attributes. Default empty array. |
| 99 | 99 | * @param string $content Optional. Block content. Default empty string. |
| | 100 | * @param string $block Optional. The block object. Default null. |
| 100 | 101 | * @return string Rendered block type output. |
| 101 | 102 | */ |
| 102 | | public function render( $attributes = array(), $content = '' ) { |
| | 103 | public function render( $attributes = array(), $content = '', $block = null ) { |
| 103 | 104 | if ( ! $this->is_dynamic() ) { |
| 104 | 105 | return ''; |
| 105 | 106 | } |
| 106 | 107 | |
| 107 | 108 | $attributes = $this->prepare_attributes_for_render( $attributes ); |
| 108 | 109 | |
| 109 | | return (string) call_user_func( $this->render_callback, $attributes, $content ); |
| | 110 | return (string) call_user_func( $this->render_callback, $attributes, $content, $block ); |
| 110 | 111 | } |
| 111 | 112 | |
| 112 | 113 | /** |