Compare commits

..

2 Commits

1 changed files with 4 additions and 2 deletions

View File

@ -43,7 +43,8 @@ if ($wordpress_endpoint) {
"title" => $item_title,
"url" => $item_url
];
if (!array_key_exists($menu_item->menu_item_parent, $items)) {
if (!isset($items[$menu_item->menu_item_parent])) {
//if (!array_key_exists($menu_item->menu_item_parent, $items)) {
$items[$menu_item->menu_item_parent] = new ArrayObject();
}
$items[$menu_item->menu_item_parent][$menu_item->ID] =$item;
@ -88,7 +89,8 @@ if (!function_exists('render_menu')) {
echo '<li id="" class="is-submenu-item is-dropdown-submenu-item" role="">'.PHP_EOL;
}
echo '<a role="" href="'.$menu_item['url'].'">'.$menu_item['title'].'</a>'.PHP_EOL;
if (array_key_exists($menu_item['id'], $items)) {
if (isset($items[$menu_item['id']])) {
//if (array_key_exists($menu_item['id'], $items)) {
render_menu($items, $menu_item['id']); // render sub menu
}
echo '</li>' . PHP_EOL;