[wp-trac] [WordPress Trac] #25263: Use wp_get_nav_menus() instead of get_terms('nav_menu') in WP_Nav_Menu_Widget

WordPress Trac noreply at wordpress.org
Mon Sep 9 11:42:09 UTC 2013


#25263: Use wp_get_nav_menus() instead of get_terms('nav_menu') in
WP_Nav_Menu_Widget
--------------------------+-----------------------------
 Reporter:  Frank Klein   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Widgets       |    Version:  3.0
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 The `wp_get_nav_menus()` function has a `wp_get_nav_menus` filter that
 allows you to filter the array of menu objects returned by the function.

 The `WP_Nav_Menu_Widget` class however uses a direct call to
 `get_terms('nav_menu')` to render the widget form. As such, the
 `wp_get_nav_menus` filter is not applied to the menus available on the
 widget configuration screen.

 The attached patch fixes this by using the `wp_get_nav_menus()` function.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25263>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list