[wp-trac] [WordPress Trac] #30684: has_nav_menu falsely returns false

WordPress Trac noreply at wordpress.org
Fri Dec 12 01:17:40 UTC 2014


#30684: has_nav_menu falsely returns false
-------------------------------+------------------------------
 Reporter:  melissahsiung      |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Menus              |     Version:  4.0.1
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by knutsp):

 * keywords:   => reporter-feedback


Comment:

 `has_nav_menu()` is not supported to return true until the user actually
 has created a menu and then assigned that menu to the menu location i
 question.

 Tested on WP 4.2-alpha (trunk, no plugins, Twenty Fifteen, a menu is
 assgned to 'primary') with the code you provided on StackExchange:

 1) Checking for 'primary': true
 2) No menu assigned to location 'global-nav': false
 3) After a menu assigned to the location 'global-nav': true

 Also tested on a live 4.0.1 installation with same results. So I can't
 confirm this neither in trunk nor in 4.0.1.

 Have you tested with no plugins, the default theme and after assigning a
 non-empty menu to the location "Global NAvigation" under Appearance -
 Menus?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30684#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list