Skip to content

Commit

Permalink
Merge pull request #272 from level-level/fix/endless_render_callback_…
Browse files Browse the repository at this point in the history
…loop

Only replace original render callback if not set
  • Loading branch information
menno-ll authored Jun 24, 2024
2 parents f2ac2cf + 2d1c453 commit 39d600e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Gutenberg/Block_Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ 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;
$this->render_callback = array( $this, 'clarkson_render_callback' );
if ( empty( $this->original_render_callback ) ) {
$this->original_render_callback = $this->render_callback;
}
$this->render_callback = array( $this, 'clarkson_render_callback' );
}

/**
Expand Down

0 comments on commit 39d600e

Please sign in to comment.