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

Automattic\WooCommerce\Blocks\Assets

AssetDataRegistry::enqueue_asset_data() public WC 1.0

Callback for enqueuing asset data via the WP api.

Note: while this is hooked into print/admin_print_scripts, it still only happens if the script attached to wc-settings handle is enqueued. This is done to allow for any potentially expensive data generation to only happen for routes that need it.

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

Хуков нет.

Возвращает

null. Ничего.

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

$AssetDataRegistry = new AssetDataRegistry();
$AssetDataRegistry->enqueue_asset_data();

Код AssetDataRegistry::enqueue_asset_data() WC 6.1.1

public function enqueue_asset_data() {
	if ( wp_script_is( $this->handle, 'enqueued' ) ) {
		$this->initialize_core_data();
		$this->execute_lazy_data();

		$data                   = rawurlencode( wp_json_encode( $this->data ) );
		$preloaded_api_requests = rawurlencode( wp_json_encode( $this->preloaded_api_requests ) );

		wp_add_inline_script(
			$this->handle,
			"
			var wcSettings = wcSettings || JSON.parse( decodeURIComponent( '" . esc_js( $data ) . "' ) );
			wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( JSON.parse( decodeURIComponent( '" . esc_js( $preloaded_api_requests ) . "' ) ) ) )
			",
			'before'
		);
	}
}