Automattic\WooCommerce\Internal\Admin
Homescreen::possibly_remove_woocommerce_menu
Possibly remove the WooCommerce menu item if it was purely used to access wc-admin pages.
Method of the class: Homescreen{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Homescreen = new Homescreen(); $Homescreen->possibly_remove_woocommerce_menu();
Homescreen::possibly_remove_woocommerce_menu() Homescreen::possibly remove woocommerce menu code WC 10.3.3
public function possibly_remove_woocommerce_menu() {
global $menu;
if ( self::is_admin_user() ) {
return;
}
foreach ( $menu as $key => $menu_item ) {
if ( self::MENU_SLUG !== $menu_item[2] || 'read' !== $menu_item[1] ) {
continue;
}
unset( $menu[ $key ] );
}
}