Automattic\WooCommerce\Blocks\BlockTypes

ProductTag::enqueue_data()protectedWC 1.0

Extra data passed through from server to client for block.

Method of the class: ProductTag{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->enqueue_data( $attributes );
$attributes(array)
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.
Default: []

ProductTag::enqueue_data() code WC 8.6.1

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

	$tag_count = wp_count_terms( 'product_tag' );

	$this->asset_data_registry->add( 'hasTags', $tag_count > 0, true );
	$this->asset_data_registry->add( 'limitTags', $tag_count > 100, true );
}