fixes back button rerender error
This commit is contained in:
parent
f9d2d65931
commit
9d3976c1cb
|
@ -39,22 +39,22 @@ if ($wordpress_endpoint) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//print_r($items);
|
||||
|
||||
function render_menu($items, $level_id) {
|
||||
echo '<ul>' . PHP_EOL;
|
||||
foreach ($items[$level_id] as $menu_item) {
|
||||
echo '<li>' . PHP_EOL;
|
||||
echo '<a href="'.$menu_item['url'].'">'.$menu_item['title'].'</a>' . PHP_EOL;
|
||||
if (array_key_exists($menu_item['id'], $items)) {
|
||||
render_menu($items, $menu_item['id']); // render sub menu
|
||||
if (!function_exists('render_menu')) {
|
||||
function render_menu($items, $level_id) {
|
||||
echo '<ul>' . PHP_EOL;
|
||||
foreach ($items[$level_id] as $menu_item) {
|
||||
echo '<li>' . PHP_EOL;
|
||||
echo '<a href="'.$menu_item['url'].'">'.$menu_item['title'].'</a>' . PHP_EOL;
|
||||
if (array_key_exists($menu_item['id'], $items)) {
|
||||
render_menu($items, $menu_item['id']); // render sub menu
|
||||
}
|
||||
echo '</li>' . PHP_EOL;
|
||||
}
|
||||
echo '</li>' . PHP_EOL;
|
||||
echo '</ul>' . PHP_EOL;
|
||||
}
|
||||
echo '</ul>' . PHP_EOL;
|
||||
}
|
||||
|
||||
if (count($items[0]) > 0) {
|
||||
render_menu($items, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue