[wp-trac] [WordPress Trac] #46042: wp_nav_menu always returns a container
WordPress Trac
noreply at wordpress.org
Sat Jan 19 18:01:43 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 | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by joyously):
Do you have a specific test case?
The code looks to me like having no menu would return false. But having a
menu with no items will return some HTML.
Also, there is always the function `has_nav_menu()` which is a better way
to test whether there is a menu or not.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46042#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list