woocommerce_get_block_types filter-hookWC 9.0.0

Filters the list of allowed block types.

Usage

add_filter( 'woocommerce_get_block_types', 'wp_kama_woocommerce_get_block_types_filter' );

/**
 * Function for `woocommerce_get_block_types` filter-hook.
 * 
 * @param array $block_types List of block types.
 *
 * @return array
 */
function wp_kama_woocommerce_get_block_types_filter( $block_types ){

	// filter...
	return $block_types;
}
$block_types(array)
List of block types.

Changelog

Since 9.0.0 Introduced.

Where the hook is called

BlockTypesController::get_block_types()
woocommerce_get_block_types
woocommerce/src/Blocks/BlockTypesController.php 391
return apply_filters( 'woocommerce_get_block_types', $block_types );

Where the hook is used in WooCommerce

woocommerce/src/Admin/Features/ProductBlockEditor/Init.php 73
add_filter( 'woocommerce_get_block_types', array( $this, 'get_block_types' ), 999, 1 );