WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта
функция не описана

Automattic\WooCommerce\Blocks\BlockTypes

AbstractBlock::enqueue_data() protected WC 1.0

Data passed through from server to client for block.

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

Хуков нет.

Возвращает

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.

Код AbstractBlock::enqueue_data() WC 5.5.2

<?php
protected function enqueue_data( array $attributes = [] ) {
	$registered_script_data = $this->integration_registry->get_all_registered_script_data();

	foreach ( $registered_script_data as $asset_data_key => $asset_data_value ) {
		if ( ! $this->asset_data_registry->exists( $asset_data_key ) ) {
			$this->asset_data_registry->add( $asset_data_key, $asset_data_value );
		}
	}

	if ( ! $this->asset_data_registry->exists( 'wcBlocksConfig' ) ) {
		$this->asset_data_registry->add(
			'wcBlocksConfig',
			[
				'buildPhase'    => Package::feature()->get_flag(),
				'pluginUrl'     => plugins_url( '/', dirname( __DIR__ ) ),
				'productCount'  => array_sum( (array) wp_count_posts( 'product' ) ),
				'restApiRoutes' => [
					'/wc/store' => array_keys( Package::container()->get( RestApi::class )->get_routes_from_namespace( 'wc/store' ) ),
				],

				/*
				 * translators: If your word count is based on single characters (e.g. East Asian characters),
				 * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
				 * Do not translate into your own language.
				 */
				'wordCountType' => _x( 'words', 'Word count type. Do not translate!', 'woocommerce' ),
			]
		);
	}
}