[wp-trac] [WordPress Trac] #20289: wp_nav_menu container is not set when menu isn't defined

WordPress Trac wp-trac at lists.automattic.com
Fri Mar 23 10:27:03 UTC 2012


#20289: wp_nav_menu container is not set when menu isn't defined
--------------------------+-------------------------------------
 Reporter:  dannydehaan   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Menus         |    Version:  3.3
 Severity:  normal        |   Keywords:  has-patch needs-testing
--------------------------+-------------------------------------
 When you use wp_nav_menu in your theme, but the actual menu isn't set via
 the backend menu interface, the container provided in the args is ignored
 and falls back to 'div'.

 Attached diff always uses container provided in args, if 'div' or 'nav' is
 provided. If no container arg is provided, falls back to using 'div'.

 {{{
 wp_nav_menu(
         array(
                 'theme_location' => 'main_menu',
                 'container'      => 'nav',
                 'menu_class'     => 'main-menu-navigation',
         )
 );
 }}}

 To test this: Use this function in your theme, without assigning a menu to
 this theme_location.

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


More information about the wp-trac mailing list