Skip to content

Commit

Permalink
Merge branch 'release/1.3.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
GregLeBarbar committed Mar 27, 2019
2 parents fe7c82d + 6d14fd2 commit 89311f5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

*1.3.2* (2019-03-28)
- Fix PHP notice messages

*1.3.1* (2019-03-21)
- Font are fetched from root www

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.1
1.3.2
12 changes: 7 additions & 5 deletions menus/submenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ function submenu_limit( $items, $args ) {

$submenu_type = $args->submenu_type ?: 'all';

$current_menu_item = reset(wp_filter_object_list( $items, array( 'current' => true ) ));
$current_menu_items = wp_filter_object_list( $items, array( 'current' => true ) );
$current_menu_item = reset($current_menu_items);
if ($current_menu_item) array_push($current_menu_item->classes, 'active');

$selectedIds = [];
Expand All @@ -38,9 +39,10 @@ function submenu_limit( $items, $args ) {
$selectedIds = submenu_get_direct_children_ids( $parent_menu_item->ID ?: 0 , $items );

} else if ($submenu_type == 'all') {
$parent_menu_item = reset(wp_filter_object_list( $items, array( 'current_item_parent' => true ) ));
$siblings = submenu_get_direct_children_ids( $parent_menu_item->ID ?: 0 , $items );
$children = submenu_get_direct_children_ids( $current_menu_item->ID ?: 0 , $items );
$parent_menu_items = wp_filter_object_list( $items, array( 'current_item_parent' => true ) );
$parent_menu_item = reset($parent_menu_items);
$siblings = submenu_get_direct_children_ids( ($parent_menu_item && $parent_menu_item->ID) ?: 0 , $items );
$children = submenu_get_direct_children_ids( ($current_menu_item && $current_menu_item->ID) ?: 0 , $items );
$selectedIds = array_merge($siblings, $children);
}

Expand Down Expand Up @@ -83,4 +85,4 @@ function submenu_get_recursive_children_ids( $id, $items ) {
}

return $ids;
}
}
4 changes: 2 additions & 2 deletions sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
}

// recover current post and menu item
$items = wp_get_nav_menu_items(get_current_menu_slug());
$item = reset(wp_filter_object_list( $items, ['object_id' => $post->ID]));
$items = wp_filter_object_list( wp_get_nav_menu_items(get_current_menu_slug()), ['object_id' => $post->ID]);
$item = reset($items);

// to display correctly the menu on level 1 pages, we need to add '.current-menu-parent' to the wrapper
$classes = '';
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.3.1
Version: 1.3.2
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: epfl
Expand Down

0 comments on commit 89311f5

Please sign in to comment.