woocommerce_hooked_blocks_pattern_exclude_list filter-hookWC 8.5.0

A list of pattern slugs to exclude from auto-insert (useful when there are patterns that have a very specific location for the block) Note: The patterns that are currently excluded are the ones that don't work well with the mini-cart block or customer-account block.


add_filter( 'woocommerce_hooked_blocks_pattern_exclude_list', 'wp_kama_woocommerce_hooked_blocks_pattern_exclude_list_filter' );

 * Function for `woocommerce_hooked_blocks_pattern_exclude_list` filter-hook.
 * @param  $array_unique 
 * @return 
function wp_kama_woocommerce_hooked_blocks_pattern_exclude_list_filter( $array_unique ){

	// filter...
	return $array_unique;


Since 8.5.0 Introduced.

Where the hook is called

In file: /src/Blocks/Utils/BlockHooksTrait.php
woocommerce/src/Blocks/Utils/BlockHooksTrait.php 153-156
$pattern_exclude_list = apply_filters(
	array_unique( array_merge( isset( $this->hooked_block_excluded_patterns ) ? $this->hooked_block_excluded_patterns : array(), array( 'twentytwentytwo/header-centered-logo', 'twentytwentytwo/header-stacked' ) ) )

Where the hook is used in WooCommerce

Usage not found.