Changeset 14620 for trunk/wp-includes/nav-menu.php
- Timestamp:
- 05/14/2010 06:20:30 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/nav-menu.php
r14614 r14620 67 67 * @since 3.0.0 68 68 * 69 * @param array Associative array of menu slot identifiers and descriptions.70 */ 71 function register_nav_menus( $ menus = array() ) {69 * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text. 70 */ 71 function register_nav_menus( $locations = array() ) { 72 72 global $_wp_registered_nav_menus; 73 73 74 74 add_theme_support( 'nav-menus' ); 75 75 76 $_wp_registered_nav_menus = $menus; 76 $_wp_registered_nav_menus = array_merge( (array) $_wp_registered_nav_menus, $locations ); 77 } 78 79 /** 80 * Register nav menu for a theme. 81 * 82 * @since 3.0.0 83 * 84 * @param string $location Menu location identifier, like a slug. 85 * @param string $description Menu location descriptive text. 86 */ 87 function register_nav_menu( $location, $description ) { 88 register_nav_menus( array( $location => $description ) ); 77 89 } 78 90 79 91 function get_registered_nav_menus() { 80 global $_wp_registered_nav_menus; 81 82 return $_wp_registered_nav_menus; 83 } 84 85 function get_nav_menu_slots() { 86 return get_theme_mod('nav_menu_slots'); 92 return $GLOBALS['_wp_registered_nav_menus']; 93 } 94 95 function get_nav_menu_locations() { 96 return get_theme_mod('nav_menu_locations'); 87 97 } 88 98
Note: See TracChangeset
for help on using the changeset viewer.