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.
Метод класса: Homescreen{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$Homescreen = new Homescreen(); $Homescreen->possibly_remove_woocommerce_menu();
Код Homescreen::possibly_remove_woocommerce_menu() Homescreen::possibly remove woocommerce menu WC 9.6.0
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 ] ); } }