Automattic\WooCommerce\Blocks\BlockTypes

ClassicTemplate::enqueue_data()protectedWC 1.0

Extra data passed through from server to client for block.

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

Хуков нет.

Возвращает

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

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->enqueue_data( $attributes );
$attributes(массив)
Any attributes that currently are available from the block. Note, this will be empty in the editor context when the block is not in the post content on editor load.
По умолчанию: []

Код ClassicTemplate::enqueue_data() WC 9.5.1

protected function enqueue_data( array $attributes = [] ) {
	parent::enqueue_data( $attributes );

	// Indicate to interactivity powered components that this block is on the page,
	// and needs refresh to update data.
	$this->asset_data_registry->add( 'needsRefreshForInteractivityAPI', true );
}