[wp-trac] [WordPress Trac] #13378: Associate nav menus with particular menu "slots" in a theme

WordPress Trac wp-trac at lists.automattic.com
Thu May 13 19:57:34 UTC 2010


#13378: Associate nav menus with particular menu "slots" in a theme
--------------------------+-------------------------------------------------
 Reporter:  ryan          |       Owner:     
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.0
Component:  Menus         |     Version:     
 Severity:  blocker       |    Keywords:     
--------------------------+-------------------------------------------------

Comment(by ryan):

 Themes do this in functions.php:

 {{{
 register_nav_menus( array('main' => __('Main Menu'), 'footer' =>
 __('Footer Menu') ) );
 }}}

 And this in templates:

 {{{
 wp_nav_menu( array('slot' => 'main') );
 wp_nav_menu( array('slot' => 'footer') );
 }}}

 In the backend, an array is set in options that is keyed by slot with the
 values being menu ids.

 {{{
 update_option( 'nav_menu_slots', array( 'main' => 1234, 'secondary' =>
 5678 ) );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13378#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list