Automattic\WooCommerce\Internal\Admin\BlockTemplates

AbstractBlock::is_detached()publicWC 1.0

Check if the block is detached from its parent block container or the template it belongs to.

Метод класса: AbstractBlock{}

Хуков нет.

Возвращает

true|false. True if the block is detached from its parent block container or the template it belongs to.

Использование

$AbstractBlock = new AbstractBlock();
$AbstractBlock->is_detached(): bool;

Код AbstractBlock::is_detached() WC 9.7.1

public function is_detached(): bool {
	$is_in_parent        = $this->parent->get_block( $this->id ) === $this;
	$is_in_root_template = $this->get_root_template()->get_block( $this->id ) === $this;

	return ! ( $is_in_parent && $is_in_root_template );
}