Skip to content

Instantly share code, notes, and snippets.

@malek1316
Last active September 11, 2018 09:53
Show Gist options
  • Save malek1316/6a52d3e44fa304223b5f3a87428d358c to your computer and use it in GitHub Desktop.
Save malek1316/6a52d3e44fa304223b5f3a87428d358c to your computer and use it in GitHub Desktop.
How can get menu location by menu id or menu select option value
$menu_id = 6;
$locations = get_nav_menu_locations();
$menu_location_name = array_search($menu_id, $locations);
echo $menu_location_name;
6 is your menu id.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment