Automattic\WooCommerce\Internal\Admin

Homescreen::possibly_remove_woocommerce_menu()publicWC 1.0

Possibly remove the WooCommerce menu item if it was purely used to access wc-admin pages.

{} Это метод класса: Homescreen{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$Homescreen = new Homescreen();
$Homescreen->possibly_remove_woocommerce_menu();

Код Homescreen::possibly_remove_woocommerce_menu() WC 6.9.4

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 ] );
	}
}