Automattic\WooCommerce\Blocks
BlockTypesController::hide_legacy_widgets_with_block_equivalent
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.
Returns
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() BlockTypesController::hide legacy widgets with block equivalent code WC 11.0.1
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;
}