Skip to content

Commit

Permalink
Merge branch 'release/1.2.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
GregLeBarbar committed Oct 22, 2018
2 parents 6f34329 + 30c409f commit 8c78434
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.11
1.2.12
2 changes: 1 addition & 1 deletion menus/submenu.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
add_filter( 'wp_nav_menu_objects', 'submenu_limit', 10, 2 );
add_filter( 'wp_nav_menu_objects', 'submenu_limit', 30, 2 );

/**
* function submenu_limit
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI:
Author: Antistatique.net
Author URI: http://antistatique.net/
Description: Description
Version: 1.2.11
Version: 1.2.12
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: epfl
Expand Down
31 changes: 20 additions & 11 deletions template-parts/breadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
<!-- Breadcrumb -->
<?php
// Breadcrumb
$items = wp_get_nav_menu_items(get_current_menu_slug());
$items = array();
foreach (wp_get_nav_menu_items(get_current_menu_slug()) as $item) {
$items[(int) $item->db_id] = $item;
}

$item = $items ? reset(wp_filter_object_list( $items, ['object_id' => $post->ID])) : false;

Expand All @@ -42,21 +45,27 @@
</a>
</li>';

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[] = "
<li class=\"breadcrumb-item active\">
{$item->title}
</li>";
} else {
$crumbs[] = "
<li class=\"breadcrumb-item\">
<a class=\"bread-link bread-home\" href=\"{$item->url}\" title=\"{$item->title}\">
{$item->title}
{$crumb_item->title}
</a>
</li>";
} else if ($item->current) {
$crumbs[] = "
<li class=\"breadcrumb-item active\">
{$item->title}
</li>";
}
}
}
Expand Down

0 comments on commit 8c78434

Please sign in to comment.