Ticket #38166: 38166.1.diff
File 38166.1.diff, 3.5 KB (added by , 9 years ago) |
---|
-
wp-includes/nav-menu-template.php
21 21 * @param array $args { 22 22 * Optional. Array of nav menu arguments. 23 23 * 24 * @type int|string|WP_Term $menu Desired menu. Accepts (matching in order) id, slug, name, menuobject. Default empty.24 * @type int|string|WP_Term $menu Desired menu. Accepts menu ID, slug, name, or object. Default empty. 25 25 * @type string $menu_class CSS class to use for the ul element which forms the menu. Default 'menu'. 26 26 * @type string $menu_id The ID that is applied to the ul element which forms the menu. 27 27 * Default is the menu slug, incremented. -
wp-includes/nav-menu.php
12 12 * 13 13 * @since 3.0.0 14 14 * 15 * @param int|string|WP_Term $menu Menu ID, slug, or name - or the menuobject.15 * @param int|string|WP_Term $menu Menu ID, slug, name, or object. 16 16 * @return WP_Term|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 ) { … … 43 43 * 44 44 * @since 4.3.0 45 45 * 46 * @param object|false$menu_obj Term from nav_menu taxonomy, or false if nothing had been found.47 * @param string $menu The menu ID, slug, or namepassed to wp_get_nav_menu_object().46 * @param WP_Term|false $menu_obj Term from nav_menu taxonomy, or false if nothing had been found. 47 * @param int|string|WP_Term $menu The menu ID, slug, name, or object passed to wp_get_nav_menu_object(). 48 48 */ 49 49 return apply_filters( 'wp_get_nav_menu_object', $menu_obj, $menu ); 50 50 } … … 56 56 * 57 57 * @since 3.0.0 58 58 * 59 * @param int|string $menu The menu to check (ID, slug, or name).59 * @param int|string|WP_Term $menu ID, slug, name, or object of menu to check. 60 60 * @return bool Whether the menu exists. 61 61 */ 62 62 function is_nav_menu( $menu ) { … … 215 215 * 216 216 * @since 3.0.0 217 217 * 218 * @param string $menu Menu ID, slug, or name.218 * @param int|string|WP_Term $menu Menu ID, slug, name, or object. 219 219 * @return bool|WP_Error True on success, false or WP_Error object on failure. 220 220 */ 221 221 function wp_delete_nav_menu( $menu ) { … … 612 612 * @global string $_menu_item_sort_prop 613 613 * @staticvar array $fetched 614 614 * 615 * @param string $menu Menu name, ID, or slug.616 * @param array $args Optional. Arguments to pass to get_posts().615 * @param int|string|WP_Term $menu Menu ID, slug, name, or object. 616 * @param array $args Optional. Arguments to pass to get_posts(). 617 617 * @return false|array $items Array of menu items, otherwise false. 618 618 */ 619 619 function wp_get_nav_menu_items( $menu, $args = array() ) { … … 772 772 773 773 $menu_item->type_label = __( 'Post Type Archive' ); 774 774 $post_content = wp_trim_words( $menu_item->post_content, 200 ); 775 $post_type_description = '' == $post_content ? $post_type_description : $post_content; 775 $post_type_description = '' == $post_content ? $post_type_description : $post_content; 776 776 $menu_item->url = get_post_type_archive_link( $menu_item->object ); 777 777 } elseif ( 'taxonomy' == $menu_item->type ) { 778 778 $object = get_taxonomy( $menu_item->object );