menu_ui_get_menus($all = TRUE)
Return an associative array of the custom menus names.
Parameters
bool $all: (optional) If FALSE return only user-added menus, or if TRUE also include the menus defined by the system. Defaults to TRUE.
Return value
array An array with the machine-readable names as the keys, and human-readable titles as the values.
File
- core/modules/menu_ui/menu_ui.module, line 478
- Allows administrators to customize the site's navigation menus.
Code
1 2 3 4 5 6 7 8 9 10 11 12 | function menu_ui_get_menus( $all = TRUE) { if ( $custom_menus = Menu::loadMultiple()) { if (! $all ) { $custom_menus = array_diff_key ( $custom_menus , menu_list_system_menus()); } foreach ( $custom_menus as $menu_name => $menu ) { $custom_menus [ $menu_name ] = $menu ->label(); } asort( $custom_menus ); } return $custom_menus ; } |
Please login to continue.