Make WordPress Core

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#30684 closed defect (bug) (invalid)

has_nav_menu falsely returns false

Reported by: melissahsiung Owned by:
Priority: normal Milestone:
Component: Menus Version: 4.0.1
Severity: normal Keywords: reporter-feedback
Cc: Focuses:

Description

has_nav_menu returns false even when a user creates a custom nav menu.

Change History (4)

#2 @knutsp
12 years ago

  • Keywords reporter-feedback added

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 in 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 described as "Global Navigation" under Appearance - Menus?

Last edited 12 years ago by knutsp (previous) (diff)

#3 @knutsp
11 years ago

  • Resolution → invalid
  • Status new → closed

No feedback in 9 months, closing. Please reopen if this is really a bug, with detailed steps to reproduce.

#4 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review
Note: See TracTickets for help on using tickets.