Automattic\WooCommerce\Blocks\BlockTypes

ProductFilterAttribute::initialize()protectedWC 1.0

Initialize this block type.

  • Hook into WP lifecycle.
  • Register the block with WordPress.

Method of the class: ProductFilterAttribute{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->initialize();

ProductFilterAttribute::initialize() code WC 9.7.1

protected function initialize() {
	parent::initialize();

	add_filter( 'woocommerce_blocks_product_filters_param_keys', array( $this, 'get_filter_query_param_keys' ), 10, 2 );
	add_filter( 'woocommerce_blocks_product_filters_selected_items', array( $this, 'prepare_selected_filters' ), 10, 2 );
	add_action( 'deleted_transient', array( $this, 'delete_default_attribute_id_transient' ) );
	add_action( 'wp_loaded', array( $this, 'register_block_patterns' ) );
}