Skip to content
Permalink
Browse files

Fixed case in menu helper build_menu method when ->classes is not an …

…array (e.g. certain cases in Customizer)
  • Loading branch information...
danielck committed Mar 19, 2019
1 parent 3f6cb0b commit eee335cda8c283fd4276159a8d48694d3b5b74ed
Showing with 10 additions and 0 deletions.
  1. +5 −0 CHANGELOG.md
  2. +5 −0 helpers/menu.php
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed
- Fixed case in menu helper build_menu method when $item->classes is not an array (e.g. certain cases in Customizer)

## [1.21.3] - 2019-03-04

### Fixed
@@ -231,6 +231,11 @@ private static function build_menu( $menu_items, $parent = 0, $type = 'page', $o
if ( $item->menu_item_parent == $parent ) {
$item->sub_menu = self::build_menu( $menu_items, $item->ID, $item->object, $override );
// Make sure $item->classes is an array. Needed to work with the Customizer.
if ( ! is_array( $item->classes ) ) {
$item->classes = [];
}
if ( is_array( $item->sub_menu ) && count( $item->sub_menu ) > 0 ) {
$item->classes[] = 'menu-item-has-children';
}

0 comments on commit eee335c

Please sign in to comment.
You can’t perform that action at this time.