WordPress at Your Fingertips
function is not described


BlockTypesController::hide_legacy_widgets_with_block_equivalent() public WC 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.

{} It's a method of the class: BlockTypesController{}

No Hooks.


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


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

Code of BlockTypesController::hide_legacy_widgets_with_block_equivalent() WC 5.7.1

public function hide_legacy_widgets_with_block_equivalent( $widget_types ) {
	array_push( $widget_types, 'woocommerce_product_search', 'woocommerce_product_categories', 'woocommerce_recent_reviews' );
	return $widget_types;