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

Automattic\WooCommerce\Blocks

Library::register_blocks() public WC 1.0

Register blocks, hooking up assets and render functions as needed.

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

Хуков нет.

Возвращает

null. Ничего.

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

$result = Library::register_blocks();

Код Library::register_blocks() WC 5.3.0

<?php
public static function register_blocks() {
	global $wp_version, $pagenow;

	$blocks = [
		'AllReviews',
		'FeaturedCategory',
		'FeaturedProduct',
		'HandpickedProducts',
		'ProductBestSellers',
		'ProductCategories',
		'ProductCategory',
		'ProductNew',
		'ProductOnSale',
		'ProductsByAttribute',
		'ProductTopRated',
		'ReviewsByProduct',
		'ReviewsByCategory',
		'ProductSearch',
		'ProductTag',
		'AllProducts',
		'PriceFilter',
		'AttributeFilter',
		'ActiveFilters',
	];

	if ( Package::feature()->is_feature_plugin_build() ) {
		$blocks[] = 'Checkout';
		$blocks[] = 'Cart';
	}

	if ( Package::feature()->is_experimental_build() ) {
		$blocks[] = 'SingleProduct';
	}

	/**
	 * This disables specific blocks in Widget Areas by not registering them.
	 */
	if ( 'themes.php' === $pagenow ) {
		$blocks = array_diff(
			$blocks,
			[
				'AllProducts',
				'PriceFilter',
				'AttributeFilter',
				'ActiveFilters',
			]
		);
	}

	// Provide block types access to assets, data registry, and integration registry.
	$asset_api     = Package::container()->get( AssetApi::class );
	$data_registry = Package::container()->get( AssetDataRegistry::class );

	foreach ( $blocks as $block_type ) {
		$block_type_class    = __NAMESPACE__ . '\\BlockTypes\\' . $block_type;
		$block_type_instance = new $block_type_class( $asset_api, $data_registry, new IntegrationRegistry() );
	}

	foreach ( self::get_atomic_blocks() as $block_type ) {
		$block_type_instance = new AtomicBlock( $asset_api, $data_registry, new IntegrationRegistry(), $block_type );
	}
}