Automattic\WooCommerce\Blocks\BlockTypes

ProductFilterTaxonomy::enqueue_dataprotectedWC 1.0

Extra data passed through from server to client for block.

Метод класса: ProductFilterTaxonomy{}

Хуки из метода

Возвращает

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()

Код ProductFilterTaxonomy::enqueue_data() WC 11.1.1

protected function enqueue_data( array $attributes = array() ) {
	parent::enqueue_data( $attributes );

	if ( is_admin() ) {
		$this->asset_data_registry->add( 'filterableProductTaxonomies', $this->get_taxonomies() );
		// Expose sortable taxonomies so the editor can show/hide "Menu order" option.
		$this->asset_data_registry->add(
			'sortableTaxonomies',
			/**
			 * Filters the list of taxonomies that support custom ordering. Filter was introduced long
			 * ago is only documented in 10.6.0.
			 *
			 * First instance in plugins/woocommerce/includes/admin/class-wc-admin-assets.php.
			 *
			 * @since 1.0
			 *
			 * @param array $sortable_taxonomies List of taxonomy slugs that support custom ordering.
			 * @return array List of taxonomy slugs that support custom ordering.
			 */
			apply_filters( 'woocommerce_sortable_taxonomies', array( 'product_cat' ) )
		);
	}
}