Automattic\WooCommerce\Internal\Admin\BlockTemplates

AbstractBlock::add_disable_condition()publicWC 1.0

Add a disable condition to the block.

The disable condition is a JavaScript-like expression that will be evaluated on the client to determine if the block should be hidden. See @woocommerce/expression-evaluation for more details.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$AbstractBlock = new AbstractBlock();
$AbstractBlock->add_disable_condition( $expression ): string;
$expression(строка) (обязательный)
An expression, which if true, will disable the block.

Код AbstractBlock::add_disable_condition() WC 9.7.1

public function add_disable_condition( string $expression ): string {
	$key = 'k' . $this->disable_conditions_counter;
	$this->disable_conditions_counter++;

	// Storing the expression in an array to allow for future expansion
	// (such as adding the plugin that added the condition).
	$this->disable_conditions[ $key ] = array(
		'expression' => $expression,
	);

	return $key;
}