#13018 closed defect (bug) (invalid)
The fallback_cb option of wp_nav_menu is always called
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Menus | Keywords: | |
Focuses: | Cc: |
Description
I find that using the following:
wp_nav_menu( array(
'sort_column' => 'menu_order',
'menu' => 'Header Menu',
'container_class' => 'headermenu',
'fallback_cb' => wp_page_menu( array( 'menu_class' => 'headermenu', 'show_home' => esc_attr( get_option('k2blogornoblog') ), 'depth' => 3 ) )
) );
The fallback_cb option is called regardless of whether or not it's supposed to. I'm not sure if I'm simply doing something wrong, as the whole feature seems woefully incomplete so far (no children, not use for the 'menu' option as far as I can tell), but I thought it was worth mentioning in case it actually is a bug.
Change History (2)
Note: See
TracTickets for help on using
tickets.
You're using
fallback_cb
wrong in this case. An example of what you want to do is something like:if no menu is found then the array of arguments is passed onto the fallback callback.
To get children in the menu drag a menu item onto the item you want to its parent (though this may change).