Automattic\WooCommerce\Blocks

AssetsController::register_script_modules()publicWC 1.0

Register script modules.

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

Хуков нет.

Возвращает

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

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

$AssetsController = new AssetsController();
$AssetsController->register_script_modules();

Код AssetsController::register_script_modules() WC 9.8.5

public function register_script_modules() {
	// Right now we only have one script modules build for supported interactivity API powered block front-ends.
	// We generate a combined asset file for that via DependencyExtractionWebpackPlugin to make registration more
	// efficient.
	$asset_data = $this->api->get_asset_data(
		$this->api->get_block_asset_build_path( 'interactivity-blocks-frontend-assets', 'php' )
	);

	foreach ( $asset_data as $handle => $data ) {
		$handle_without_js = str_replace( '.js', '', $handle );
		wp_register_script_module( $handle_without_js, plugins_url( $this->api->get_block_asset_build_path( $handle_without_js ), dirname( __DIR__ ) ), $data['dependencies'], $data['version'] );
	}
}