Skip to content

Commit

Permalink
Merge branch 'release/1.9.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
GregLeBarbar committed Jan 8, 2020
2 parents a2b24e6 + d0c0282 commit fe0d78e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# CHANGELOG
*1.9.1* (2020-01-08)
- Delete PHP Notice et Warnings (#251)

*1.9.0* (2020-01-08)
- New element version 2.0.6
- Update footer
Expand Down
2 changes: 1 addition & 1 deletion wp-theme-2018/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.0
1.9.1
37 changes: 28 additions & 9 deletions wp-theme-2018/menus/custom-nav-walker.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,16 @@ public function start_lvl( &$output, $depth = 0, $args = array() ) {
}
}

/**
* @remark Default value of $args is an empty array but parameter can also be an object (if given)..
* A big thanks to Antistatic who coded like this... #facepalm
*/
public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
$this->currentItem = $item;

if(array_key_exists('item_spacing', $args) && $args['item_spacing'] === 'discard') {
/* Because $args can be an array or an object, we have to check differently... */
if( (is_array($args) && array_key_exists('item_spacing', $args) && $args['item_spacing'] === 'discard') ||
(property_exists($args, 'item_spacing') && $args->item_spacing == 'discard') ) {
$t = '';
$n = '';
} else {
Expand Down Expand Up @@ -167,14 +173,27 @@ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0
*/
$title = apply_filters( 'nav_menu_item_title', $title, $item, $args, $depth );

$item_output = array_key_exists('before', $args)? $args['before']:'';
$item_output .= '<a'. $attributes .'>';
$item_output .= (array_key_exists('link_before', $args)? $args['link_before']:'') .
$title .
(array_key_exists('link_after', $args)? $args['link_after']:'');
$item_output .= '</a>';
$item_output .= array_key_exists('after', $args)? $args['after']:'';

if(is_array($args))
{
$item_output = array_key_exists('before', $args)? $args['before']:'';
$item_output .= '<a'. $attributes .'>';
$item_output .= (array_key_exists('link_before', $args)? $args['link_before']:'') .
$title .
(array_key_exists('link_after', $args)? $args['link_after']:'');
$item_output .= '</a>';
$item_output .= array_key_exists('after', $args)? $args['after']:'';
}
else // $args is an object
{
$item_output = property_exists($args, 'before')? $args->before:'';
$item_output .= '<a'. $attributes .'>';
$item_output .= (property_exists($args, 'link_before')? $args->link_before:'') .
$title .
(property_exists($args, 'link_after')? $args->link_after:'');
$item_output .= '</a>';
$item_output .= property_exists($args, 'after')? $args->after:'';
}

if(is_array($item->classes) && in_array('menu-item-has-children', $item->classes)) {
$item_output .= '
<a href="#" role="button" aria-hidden="true" class="nav-arrow">
Expand Down
2 changes: 1 addition & 1 deletion wp-theme-2018/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.9.0
Version: 1.9.1
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: epfl
Expand Down

0 comments on commit fe0d78e

Please sign in to comment.