WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks

AssetsController::register_assets() public WC 1.0

Register block scripts & styles.

{} It's a method of the class: AssetsController{}

No Hooks.

Return

null. Nothing.

Usage

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

Code of AssetsController::register_assets() WC 5.7.1

public function register_assets() {
	$this->register_style( 'wc-blocks-vendors-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks-vendors-style', 'css' ), __DIR__ ) );
	$this->register_style( 'wc-blocks-editor-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks-editor-style', 'css' ), __DIR__ ), [ 'wp-edit-blocks' ], 'all', true );
	$this->register_style( 'wc-blocks-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks-style', 'css' ), __DIR__ ), [ 'wc-blocks-vendors-style' ], 'all', true );

	$this->api->register_script( 'wc-blocks-middleware', 'build/wc-blocks-middleware.js', [], false );
	$this->api->register_script( 'wc-blocks-data-store', 'build/wc-blocks-data.js', [ 'wc-blocks-middleware' ] );
	$this->api->register_script( 'wc-blocks-vendors', $this->api->get_block_asset_build_path( 'wc-blocks-vendors' ), [], false );
	$this->api->register_script( 'wc-blocks-registry', 'build/wc-blocks-registry.js', [], false );
	$this->api->register_script( 'wc-blocks', $this->api->get_block_asset_build_path( 'wc-blocks' ), [ 'wc-blocks-vendors' ], false );
	$this->api->register_script( 'wc-blocks-shared-context', 'build/wc-blocks-shared-context.js', [] );
	$this->api->register_script( 'wc-blocks-shared-hocs', 'build/wc-blocks-shared-hocs.js', [], false );

	// The price package is shared externally so has no blocks prefix.
	$this->api->register_script( 'wc-price-format', 'build/price-format.js', [], false );

	if ( Package::feature()->is_feature_plugin_build() ) {
		$this->api->register_script( 'wc-blocks-checkout', 'build/blocks-checkout.js', [] );
	}

	wp_add_inline_script(
		'wc-blocks-middleware',
		"
		var wcBlocksMiddlewareConfig = {
			storeApiNonce: '" . esc_js( wp_create_nonce( 'wc_store_api' ) ) . "',
			wcStoreApiNonceTimestamp: '" . esc_js( time() ) . "'
		};
		",
		'before'
	);
}