Automattic\WooCommerce\Blocks\BlockTypes
ProductFilters::enqueue_data
Extra data passed through from server to client for block.
Method of the class: ProductFilters{}
No Hooks.
Returns
null. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->enqueue_data( $attributes );
- $attributes(array)
- Any attributes that currently are available from the block. Note, this will be empty in the editor context when the block is not in the post content on editor load.
Default:array()
ProductFilters::enqueue_data() ProductFilters::enqueue data code WC 10.8.1
protected function enqueue_data( array $attributes = array() ) {
global $pagenow;
parent::enqueue_data( $attributes );
BlocksSharedState::load_store_config( 'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WooCommerce' );
// Classic themes do not support client-side navigation on product
// archive pages, so disable it globally for the Interactivity Router.
$is_product_archive = is_shop() || is_product_taxonomy() || ( is_search() && 'product' === get_post_type() );
if ( ! wp_is_block_theme() && $is_product_archive ) {
wp_interactivity_config( 'core/router', array( 'clientNavigationDisabled' => true ) );
}
}