Changeset 32612
- Timestamp:
- 05/26/2015 10:09:26 PM (10 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/nav-menu-template.php
r31168 r32612 195 195 * 196 196 * @since 3.0.0 197 * 198 * @staticvar array $menu_id_slugs 197 199 * 198 200 * @param array $args { … … 220 222 * Uses printf() format with numbered placeholders. 221 223 * } 222 * @return mixed Menu output if $echo is false, false if there are no items or no menu was found.224 * @return object|false|void Menu output if $echo is false, false if there are no items or no menu was found. 223 225 */ 224 226 function wp_nav_menu( $args = array() ) { … … 430 432 * @access private 431 433 * @since 3.0.0 434 * 435 * @global WP_Query $wp_query 436 * @global WP_Rewrite $wp_rewrite 432 437 * 433 438 * @param array $menu_items The current menu item objects to which to add the class property information. … … 652 657 * @uses Walker_Nav_Menu to create HTML list content. 653 658 * @since 3.0.0 654 * @see Walker::walk() for parameters and return description. 659 * 660 * @param array $items 661 * @param int $depth 662 * @param object $r 663 * @return string 655 664 */ 656 665 function walk_nav_menu_tree( $items, $depth, $r ) { … … 658 667 $args = array( $items, $depth, $r ); 659 668 660 return call_user_func_array( array( $walker, 'walk'), $args );669 return call_user_func_array( array( $walker, 'walk' ), $args ); 661 670 } 662 671 … … 666 675 * @since 3.0.1 667 676 * @access private 677 * 678 * @staticvar array $used_ids 679 * @param string $id 680 * @param object $item 681 * @return string 668 682 */ 669 683 function _nav_menu_item_id_use_once( $id, $item ) { 670 684 static $_used_ids = array(); 671 if ( in_array( $item->ID, $_used_ids ) ) 685 if ( in_array( $item->ID, $_used_ids ) ) { 672 686 return ''; 687 } 673 688 $_used_ids[] = $item->ID; 674 689 return $id; -
trunk/src/wp-includes/nav-menu.php
r32294 r32612 14 14 * 15 15 * @param string $menu Menu ID, slug, or name. 16 * @return mixed false if $menu param isn't supplied or term does not exist, menu object if successful.16 * @return object|false False if $menu param isn't supplied or term does not exist, menu object if successful. 17 17 */ 18 18 function wp_get_nav_menu_object( $menu ) { … … 66 66 * @since 3.0.0 67 67 * 68 * @global array $_wp_registered_nav_menus 69 * 68 70 * @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text. 69 71 */ … … 78 80 /** 79 81 * Unregisters a navigation menu for a theme. 82 * 83 * @global array $_wp_registered_nav_menus 80 84 * 81 85 * @param string $location The menu location identifier. … … 100 104 * @since 3.0.0 101 105 * 102 * @param string $location Menu location identifier, like a slug.106 * @param string $location Menu location identifier, like a slug. 103 107 * @param string $description Menu location descriptive text. 104 108 */ … … 110 114 * 111 115 * @since 3.0.0 116 * 117 * @global array $_wp_registered_nav_menus 118 * 112 119 * @return array 113 120 */ … … 135 142 * 136 143 * @since 3.0.0 144 * 137 145 * @param string $location Menu location identifier. 138 146 * @return bool Whether location has a menu. … … 221 229 * @since 3.0.0 222 230 * 223 * @param int $menu_idThe ID of the menu or "0" to create a new menu.231 * @param int $menu_id The ID of the menu or "0" to create a new menu. 224 232 * @param array $menu_data The array of menu data. 225 233 * @return int|WP_Error Menu ID on success, WP_Error object on failure. … … 299 307 * @since 3.0.0 300 308 * 301 * @param int $menu_idThe ID of the menu. Required. If "0", makes the menu item a draft orphan.302 * @param int $menu_item_db_id The ID of the menu item. If "0", creates a new menu item.303 * @param array $menu_item_data The menu item's data.309 * @param int $menu_id The ID of the menu. Required. If "0", makes the menu item a draft orphan. 310 * @param int $menu_item_db_id The ID of the menu item. If "0", creates a new menu item. 311 * @param array $menu_item_data The menu item's data. 304 312 * @return int|WP_Error The menu item's database ID or WP_Error object on failure. 305 313 */ … … 487 495 * @access private 488 496 * 497 * @global string $_menu_item_sort_prop 498 * 489 499 * @param object $a The first object to compare 490 500 * @param object $b The second object to compare … … 523 533 */ 524 534 function _is_valid_nav_menu_item( $item ) { 525 if ( ! empty( $item->_invalid ) ) 526 return false; 527 528 return true; 535 return empty( $item->_invalid ); 529 536 } 530 537 … … 533 540 * 534 541 * @since 3.0.0 542 * 543 * @global string $_menu_item_sort_prop 544 * @staticvar array $fetched 535 545 * 536 546 * @param string $menu Menu name, ID, or slug. 537 547 * @param array $args Optional. Arguments to pass to {@see get_posts()}. 538 * @return mixed$items Array of menu items, otherwise false.548 * @return false|array $items Array of menu items, otherwise false. 539 549 */ 540 550 function wp_get_nav_menu_items( $menu, $args = array() ) { … … 783 793 * @since 3.0.0 784 794 * 785 * @param int $object_idThe ID of the original object.795 * @param int $object_id The ID of the original object. 786 796 * @param string $object_type The type of object, such as "taxonomy" or "post_type." 787 * @param string $taxonomy If $object_type is "taxonomy", $taxonomy is the name of the tax that $object_id belongs to797 * @param string $taxonomy If $object_type is "taxonomy", $taxonomy is the name of the tax that $object_id belongs to 788 798 * @return array The array of menu item IDs; empty array if none; 789 799 */ … … 869 879 * @param string $new_status The new status of the post object. 870 880 * @param string $old_status The old status of the post object. 871 * @param object $post The post object being transitioned from one status to another. 872 * @return void 881 * @param object $post The post object being transitioned from one status to another. 873 882 */ 874 883 function _wp_auto_add_pages_to_menu( $new_status, $old_status, $post ) {
Note: See TracChangeset
for help on using the changeset viewer.