Automattic\WooCommerce\Blocks\BlockTypes
ProductFilters::enqueue_data
Extra data passed through from server to client for block.
Метод класса: ProductFilters{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->enqueue_data( $attributes );
- $attributes(массив)
- 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.
По умолчанию:array()
Код ProductFilters::enqueue_data() ProductFilters::enqueue data WC 10.5.0
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' );
wp_interactivity_config(
$this->get_full_block_name(),
[
'isProductArchive' => is_shop() || is_product_taxonomy() || ( is_search() && 'product' === get_post_type() ),
]
);
}