Opened 11 years ago
Closed 11 years ago
#25263 closed defect (bug) (fixed)
Use wp_get_nav_menus() instead of get_terms('nav_menu') in WP_Nav_Menu_Widget
Reported by: | Frank Klein | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 3.7 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Widgets | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
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.
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
This should probably be
wp_get_nav_menus( array( 'orderby' => 'name' ) )
to keep the current ordering (unlikeget_terms()
,wp_get_nav_menus()
uses'none'
by default).