[wp-trac] [WordPress Trac] #27735: unregister_nav_menu leaves menu visible after it has been set

WordPress Trac noreply at wordpress.org
Tue May 27 10:40:48 UTC 2014


#27735: unregister_nav_menu leaves menu visible after it has been set
--------------------------+------------------------------
 Reporter:  mbootsman     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Menus         |     Version:  3.8.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  administration
--------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:   => has-patch


Comment:

 Confirmed. `unregister_nav_menu()` has no effect on `has_nav_menu()` or
 `wp_nav_menu()`.

 `has_nav_menu()` description says: "Whether a registered nav menu location
 has a menu assigned to it", but it doesn't actually check if the location
 is registered: [source:tags/3.9.1/src/wp-includes/nav-menu.php#L125].

 [attachment:27735.patch] fixes that. Perhaps the same check should be
 added to `wp_nav_menu()` where it checks for a menu based on
 `theme_location`: [source:tags/3.9.1/src/wp-includes/nav-menu-
 template.php#L276].

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


More information about the wp-trac mailing list