Skip to content

Commit

Permalink
chore(menu-builder): nitpicking
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x authored Apr 30, 2021
1 parent f9baca6 commit 71731de
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/MenuBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MenuBuilder
protected $menu = [];

/**
* Attributes Map
* The attributes map.
*
* @var array
*/
Expand All @@ -35,15 +35,15 @@ class MenuBuilder
];

/**
* Excluded Classes
* The disallowed classes.
*
* @var array
*/
protected $excluded_classes = [
protected $disallowedClasses = [
'current-menu',
'current_page',
'sub-menu',
// 'menu-item',
'menu-item',
'menu-item-type-post_type',
'menu-item-object-page',
'menu-item-type-custom',
Expand Down Expand Up @@ -92,7 +92,7 @@ protected function filter($menu = [])

return array_map(function ($item) {
$classes = array_filter($item->classes, function ($class) {
return !in_array($class, $this->excluded_classes);
return ! in_array($class, $this->disallowedClasses);
});

$item->classes = is_array($classes) ? implode(' ', $classes) : $classes;
Expand Down

0 comments on commit 71731de

Please sign in to comment.