Automattic\WooCommerce\EmailEditor\Engine\Patterns

Patterns::register_block_pattern_categoriesprivateWC 1.0

Register block pattern category.

Method of the class: Patterns{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->register_block_pattern_categories(): void;

Patterns::register_block_pattern_categories() code WC 10.9.1

private function register_block_pattern_categories(): void {
	$categories = array(
		array(
			'name'        => 'email-contents',
			'label'       => _x( 'Email Contents', 'Block pattern category', 'woocommerce' ),
			'description' => __( 'A collection of email content layouts.', 'woocommerce' ),
		),
	);
	foreach ( $categories as $category ) {
		register_block_pattern_category(
			$category['name'],
			array(
				'label'       => $category['label'],
				'description' => $category['description'] ?? '',
			)
		);
	}
}