Ticket #13378: 14720.patch
File 14720.patch, 2.9 KB (added by , 14 years ago) |
---|
-
wp-includes/nav-menu-template.php
183 183 * depth - how many levels of the hierarchy are to be included. 0 means all. Defaults to 0. 184 184 * walker - allows a custom walker to be specified. 185 185 * context - the context the menu is used in. 186 * 186 * theme_location - the location in the theme to be used. Must be registed with register_nav_menu in order to be selectable by the user 187 * 187 188 * @todo show_home - If you set this argument, then it will display the link to the home page. The show_home argument really just needs to be set to the value of the text of the link. 188 189 * 189 190 * @since 3.0.0 -
wp-includes/nav-menu.php
12 12 * 13 13 * @since 3.0.0 14 14 * 15 * @param string $menu Menu id 16 * @return mixed $menu|false Or WP_Error 15 * @uses get_term 16 * @uses get_term_by 17 * 18 * @param string $menu Menu id, slug or name 19 * @return mixed false if $menu param isn't supplied or term does not exist, menu object if successfull 17 20 */ 18 21 function wp_get_nav_menu_object( $menu ) { 19 22 if ( ! $menu ) … … 41 44 * 42 45 * @since 3.0.0 43 46 * 44 * @param int|string $menu The menu to check 47 * @param int|string $menu The menu to check (ID, Slug, or Name) 45 48 * @return bool Whether the menu exists. 46 49 */ 47 50 function is_nav_menu( $menu ) { … … 87 90 function register_nav_menu( $location, $description ) { 88 91 register_nav_menus( array( $location => $description ) ); 89 92 } 90 93 /** 94 * Returns an array of all registered nav menus in a theme 95 * 96 * @since 3.0.0 97 * 98 * @return array 99 * 100 */ 91 101 function get_registered_nav_menus() { 92 102 return $GLOBALS['_wp_registered_nav_menus']; 93 103 } 94 104 105 /** 106 * Returns an array with the registered nav menu locations and the menu assigned to it 107 * 108 * @since 3.0.0 109 * 110 * @retun array 111 */ 112 95 113 function get_nav_menu_locations() { 96 114 return get_theme_mod('nav_menu_locations'); 97 115 } … … 468 486 $object_id = get_post_meta( $item->ID, '_menu_item_object_id', true ); 469 487 $object = get_post_meta( $item->ID, '_menu_item_object', true ); 470 488 $type = get_post_meta( $item->ID, '_menu_item_type', true ); 471 489 472 490 if ( 'post_type' == $type ) 473 491 $posts[$object][] = $object_id; 474 492 elseif ( 'taxonomy' == $type) 475 493 $terms[$object][] = $object_id; 476 494 } 477 495 478 496 if ( !empty($posts) ) { 479 497 foreach ( array_keys($posts) as $post_type ) { 480 498 get_posts( array('post__in' => $posts[$post_type], 'post_type' => $post_type, 'nopaging' => true, 'update_post_term_cache' => false) ); 481 499 } 482 500 } 483 501 unset($posts); 484 502 485 503 if ( !empty($terms) ) { 486 504 foreach ( array_keys($terms) as $taxonomy ) { 487 505 get_terms($taxonomy, array('include' => $terms[$taxonomy]) );