public function is_known_block_type($blockname, $includeinvisible = false) {
        $blocks = $this->get_installed_blocks();
        foreach ($blocks as $block) {
            if ($block->name == $blockname && ($includeinvisible || $block->visible)) {
                return true;
            }
        }
        return false;
    }
public function is_known_block_type($blockname, $includeinvisible = false) {
        $blocks = $this->get_installed_blocks();
        foreach ($blocks as $block) {
            if ($block->name == $blockname && ($includeinvisible || $block->visible)) {
                return true;
            }
        }
        return false;
    }
public function is_known_block_type ( $ blockname , $ includeinvisible = false ) { $ blocks = $ this -> get_installed_blocks ( ) ; foreach ( $ blocks as $ block ) { if ( $ block -> name == $ blockname && ( $ includeinvisible || $ block -> visible ) ) { return true ; } } return false ; }
Find out if a block type is known by the system

@param string $blockname the name of the type of block.
@param boolean $includeinvisible if false (default) only check 'visible' blocks, that is, blocks enabled by the admin.
@return boolean true if this block in installed.
Find out if a block type is known by the system