From bcdc08f832cc9a51f0db9e00bf7378dbaad5f3af Mon Sep 17 00:00:00 2001 From: Geoff Dusome Date: Tue, 5 Mar 2024 15:11:28 -0500 Subject: [PATCH] [MOOSE-81]: update ACF block render template function --- .../plugins/core/src/Blocks/Block_Registrar.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wp-content/plugins/core/src/Blocks/Block_Registrar.php b/wp-content/plugins/core/src/Blocks/Block_Registrar.php index dd0a66a4..d3db7686 100644 --- a/wp-content/plugins/core/src/Blocks/Block_Registrar.php +++ b/wp-content/plugins/core/src/Blocks/Block_Registrar.php @@ -25,11 +25,15 @@ public function register( string $block_name, string $blocks_dir = self::BLOCKS_ } /** - * @param array $args + * @param array $block The block attributes. + * @param string $content The block content. + * @param bool $is_preview Whether the block is being rendered for editing preview. + * @param int $post_id The current post being edited or viewed. + * @param \WP_Block|null $wp_block The block instance (since WP 5.5). */ - public function render_template( array $args ): void { - $template = $args['render_template']; - $path = str_replace( 'dist/blocks/', 'blocks/', $args['path'] ); + public function render_template( array $block, string $content = '', bool $is_preview = false, int $post_id = 0, ?\WP_Block $wp_block = null ): void { + $template = $block['render_template']; + $path = str_replace( 'dist/blocks/', 'blocks/', $block['path'] ); if ( ! file_exists( "$path/$template" ) ) { return;