[wp-trac] [WordPress Trac] #46042: wp_nav_menu always returns a container
WordPress Trac
noreply at wordpress.org
Sat Jan 19 16:03:15 UTC 2019
#46042: wp_nav_menu always returns a container
--------------------------+-----------------------------
Reporter: thememason | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Menus | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
wp_nav_menu('container' => false) is returning an empty div when there is
no menu items. This should return either false or an empty string. You can
change the div to a different element, but you cannot remove the
container.
This makes it difficult to test whether the menu is empty or not. Checking
!empty($menu) no longer works like it used to.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46042>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list