Skip to content

Commit 7538ce1

Browse files
author
Miika Arponen
authored
Merge pull request #135 from aihamaki/menu-exists-fix
Fixed a bug in the menu helper that caused fatal errors when the menu did not exist
2 parents d9911e8 + b36ee1f commit 7538ce1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
### Fixed
8+
- A bug in the menu helper that caused fatal errors when the menu did not exist.
9+
710
## [1.26.2] - 2019-11-13
811

912
### Fixed

Diff for: helpers/menu.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public static function get_menu_data( $menu_name, $parent = 0, $override = null,
150150
}
151151
}
152152

153-
if ( isset( $menu_object) ) {
153+
if ( ! empty( $menu_object ) ) {
154154
$menu_items = static::get_cached_menu_items( $menu_object->term_id );
155155

156156
if ( empty( $menu_items ) || \is_customize_preview() ) {

0 commit comments

Comments
 (0)