Automattic\WooCommerce\Blocks

BlockTypesController::hide_legacy_widgets_with_block_equivalent()publicWC 1.0

Hide legacy widgets with a feature complete block equivalent in the inserter and prevent them from showing as an option in the Legacy Widget block.

Method of the class: BlockTypesController{}

No Hooks.

Return

Array. $widget_types An array including the WooCommerce widgets to hide.

Usage

$BlockTypesController = new BlockTypesController();
$BlockTypesController->hide_legacy_widgets_with_block_equivalent( $widget_types );
$widget_types(array) (required)
An array of widgets hidden in core.

BlockTypesController::hide_legacy_widgets_with_block_equivalent() code WC 9.4.2

public function hide_legacy_widgets_with_block_equivalent( $widget_types ) {
	array_push(
		$widget_types,
		'woocommerce_product_search',
		'woocommerce_product_categories',
		'woocommerce_recent_reviews',
		'woocommerce_product_tag_cloud',
		'woocommerce_price_filter',
		'woocommerce_layered_nav',
		'woocommerce_layered_nav_filters',
		'woocommerce_rating_filter'
	);

	return $widget_types;
}