Automattic\WooCommerce\Admin\Features\ProductBlockEditor

BlockRegistry::register_categories()publicWC 1.0

Register product related block categories.

Method of the class: BlockRegistry{}

No Hooks.

Return

null. Nothing (null).

Usage

$BlockRegistry = new BlockRegistry();
$BlockRegistry->register_categories( $block_categories, $editor_context );
$block_categories(array[]) (required)
Array of categories for block types.
$editor_context(WP_Block_Editor_Context) (required)
The current block editor context.

BlockRegistry::register_categories() code WC 9.7.1

public function register_categories( $block_categories, $editor_context ) {
	if ( INIT::EDITOR_CONTEXT_NAME === $editor_context->name ) {
		$block_categories[] = array(
			'slug'  => 'woocommerce',
			'title' => __( 'WooCommerce', 'woocommerce' ),
			'icon'  => null,
		);
	}

	return $block_categories;
}