From 5d9e948a48381e0e0f0796afb55c1ba93a6657ad Mon Sep 17 00:00:00 2001 From: Menno van den Ende <50165380+menno-ll@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:54:02 +0200 Subject: [PATCH 1/2] Only replace original render callback if not set --- src/Gutenberg/Block_Type.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Gutenberg/Block_Type.php b/src/Gutenberg/Block_Type.php index 778e61a..9e03cd4 100644 --- a/src/Gutenberg/Block_Type.php +++ b/src/Gutenberg/Block_Type.php @@ -23,7 +23,9 @@ class Block_Type extends \WP_Block_Type { */ public function __construct( $block_type, $args = array() ) { parent::__construct( $block_type, $args ); - $this->original_render_callback = $this->render_callback; + if ( empty( $this->original_render_callback ) ) { + $this->original_render_callback = $this->render_callback; + } $this->render_callback = array( $this, 'clarkson_render_callback' ); } From 2d1c453c525005088586f32b7a1e4e4e9737e462 Mon Sep 17 00:00:00 2001 From: Menno van den Ende <50165380+menno-ll@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:58:48 +0200 Subject: [PATCH 2/2] fix space --- src/Gutenberg/Block_Type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gutenberg/Block_Type.php b/src/Gutenberg/Block_Type.php index 9e03cd4..5b25c69 100644 --- a/src/Gutenberg/Block_Type.php +++ b/src/Gutenberg/Block_Type.php @@ -26,7 +26,7 @@ public function __construct( $block_type, $args = array() ) { if ( empty( $this->original_render_callback ) ) { $this->original_render_callback = $this->render_callback; } - $this->render_callback = array( $this, 'clarkson_render_callback' ); + $this->render_callback = array( $this, 'clarkson_render_callback' ); } /**