Automattic\WooCommerce\Admin\Features\ProductBlockEditor
BlockRegistry::register_categories
Register product related block categories.
Метод класса: BlockRegistry{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$BlockRegistry = new BlockRegistry(); $BlockRegistry->register_categories( $block_categories, $editor_context );
- $block_categories(array[]) (обязательный)
- Array of categories for block types.
- $editor_context(WP_Block_Editor_Context) (обязательный)
- The current block editor context.
Код BlockRegistry::register_categories() BlockRegistry::register categories WC 10.5.2
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;
}