Determine if block has already been registered

Question

In gutenberg/block-editor, how can I check whether I’ve already registered a block type? Is there a function I can use? Searching through the Block Editor Handbook I couldn’t see a function to check this.

An example of what I am trying to do is below:

class My_Block {

    public function __construct() {
        if ( ! SOME_FUNCTION_block_exists('foo/column') ) {
            register_block_type( 'foo/column', my_args );
        }
    }
    
}

0
sazr 5 months 2022-03-02T19:40:48-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse