/ Published in: PHP
Example call: $menuName = sleekgetthememenuname('footer-menu')
Expand |
Embed | Plain Text
/*----------------------------------------------------------- Get a theme menu name in slug format based on a location parameter. -----------------------------------------------------------*/ function sleek_get_theme_menu_name($theme_location) { if(!$theme_location) return false; $theme_locations = get_nav_menu_locations(); $menu_obj = get_term($theme_locations[$theme_location],'nav_menu'); if(!$menu_obj) $menu_obj = false; // Make a slug out of the menu name now we know it exists return $menu_name; }
You need to login to post a comment.
