diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b37a6af..b498bd03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # CHANGELOG +*1.2.12* (2018-10-22) + - Quick menu-related fixes (#122) + *1.2.11* (2018-10-16) - Fix infoscience search warnings (#116) - Allow to set multiple columns on people render (#110) diff --git a/VERSION b/VERSION index c1147005..f2ae0b4a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.11 +1.2.12 diff --git a/menus/submenu.php b/menus/submenu.php index 3ad99598..971755d9 100644 --- a/menus/submenu.php +++ b/menus/submenu.php @@ -1,5 +1,5 @@ db_id] = $item; + } $item = $items ? reset(wp_filter_object_list( $items, ['object_id' => $post->ID])) : false; @@ -42,21 +45,27 @@ '; - if ($items) { - _wp_menu_item_classes_by_context( $items ); // Set up the class variables, including current-classes - foreach($items as $item) { - if ($item->current_item_ancestor) { + $crumb_items = array(); + for($crumb_item = $item; + $crumb_item; + $crumb_item = $items[(int) $crumb_item->menu_item_parent]) + { + array_unshift($crumb_items, $crumb_item); + } + if ($crumb_items) { + foreach($crumb_items as $crumb_item) { + if ((int) $item->db_id === (int) $crumb_item->db_id) { + $crumbs[] = " +
  • + {$item->title} +
  • "; + } else { $crumbs[] = "
  • url}\" title=\"{$item->title}\"> - {$item->title} + {$crumb_item->title}
  • "; - } else if ($item->current) { - $crumbs[] = " -
  • - {$item->title} -
  • "; } } }