Automattic\WooCommerce\Admin

PageController::remove_app_entry_page_menu_item()publicWC 1.0

Remove the menu item for the app entry point page.

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

Хуков нет.

Возвращает

null. Ничего.

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

$PageController = new PageController();
$PageController->remove_app_entry_page_menu_item();

Код PageController::remove_app_entry_page_menu_item() WC 6.6.1

public function remove_app_entry_page_menu_item() {
	global $submenu;
	// User does not have capabilites to see the submenu.
	if ( ! current_user_can( 'manage_woocommerce' ) || empty( $submenu['woocommerce'] ) ) {
		return;
	}

	$wc_admin_key = null;
	foreach ( $submenu['woocommerce'] as $submenu_key => $submenu_item ) {
		// Our app entry page menu item has no title.
		if ( is_null( $submenu_item[0] ) && self::APP_ENTRY_POINT === $submenu_item[2] ) {
			$wc_admin_key = $submenu_key;
			break;
		}
	}

	if ( ! $wc_admin_key ) {
		return;
	}

	unset( $submenu['woocommerce'][ $wc_admin_key ] );
}