' . $title . ''; if ( !empty( $item->description ) ) $return .= '' . $item->description . ''; return $return; } endif; add_filter( 'nav_menu_item_title', 'hootubix_theme_menu_description', 5, 4 ); /** * Get the top level menu items array * * @since 1.0 * @access public * @return void */ function hootubix_nav_menu_toplevel_items( $theme_location = 'hoot-primary' ) { static $location_items; if ( !isset( $location_items[$theme_location] ) && ($theme_locations = get_nav_menu_locations()) && isset( $theme_locations[$theme_location] ) ) { $menu_obj = get_term( $theme_locations[$theme_location], 'nav_menu' ); if ( !empty( $menu_obj->term_id ) ) { $menu_items = wp_get_nav_menu_items($menu_obj->term_id); if ( $menu_items ) foreach( $menu_items as $menu_item ) if ( empty( $menu_item->menu_item_parent ) ) $location_items[$theme_location][] = $menu_item; } } if ( !empty( $location_items[$theme_location] ) ) return $location_items[$theme_location]; else return array(); }