From cdf005f8ea27d9e1039fcc87e5e6a112de626acc Mon Sep 17 00:00:00 2001 From: htmldiz Date: Mon, 29 Jul 2024 03:21:35 +0300 Subject: [PATCH] Update Block_Container.php The issues missing Block variable: https://github.com/htmlburger/carbon-fields/issues/1244 --- core/Container/Block_Container.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/core/Container/Block_Container.php b/core/Container/Block_Container.php index 25075f6e..b5305387 100644 --- a/core/Container/Block_Container.php +++ b/core/Container/Block_Container.php @@ -438,21 +438,20 @@ public function get_post_id() { * * @param array $attributes * @param string $content + * @param \WP_Block $block * @return string */ - public function render_block( $attributes, $content ) { + public function render_block( $attributes, $content, $block = null ) { // added variable at the end $fields = $attributes['data']; $post_id = $this->get_post_id(); - // Unset the "data" property because we // pass it as separate argument to the callback. unset($attributes['data']); - ob_start(); - - call_user_func( $this->render_callback , $fields, $attributes, $content, $post_id ); - - return ob_get_clean(); + call_user_func( $this->render_callback , $fields, $attributes, $content, $post_id, $block ); + $toReturn = ob_get_contents(); + ob_clean(); + return $toReturn; } /**