getParentMenuId

open fun getParentMenuId(childMenuId: Int): Int

Returns the parent menu item ID for a given child menu item ID. If the child is a top-level menu item, returns the same ID. If the child is in a submenu, returns the parent menu item's ID.

Return

The parent menu item ID, or 0 if the child is not found.

Parameters

childMenuId

The ID of the menu item to find the parent for.