Changeset 32294
- Timestamp:
- 04/24/2015 06:57:07 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/nav-menu.php
r31748 r32294 586 586 if ( ! empty( $terms ) ) { 587 587 foreach ( array_keys($terms) as $taxonomy ) { 588 get_terms($taxonomy, array('include' => $terms[$taxonomy]) ); 588 get_terms( $taxonomy, array( 589 'include' => $terms[ $taxonomy ], 590 'hierarchical' => false, 591 ) ); 589 592 } 590 593 } -
trunk/tests/phpunit/tests/post/nav-menu.php
r29792 r32294 118 118 } 119 119 120 public function test_wp_get_nav_menu_items_with_taxonomy_term() { 121 register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true ) ); 122 $t = $this->factory->term->create( array( 'taxonomy' => 'wptests_tax' ) ); 123 $child_terms = $this->factory->term->create_many( 2, array( 'taxonomy' => 'wptests_tax', 'parent' => $t ) ); 124 125 $term_menu_item = wp_update_nav_menu_item( $this->menu_id, 0, array( 126 'menu-item-type' => 'taxonomy', 127 'menu-item-object' => 'wptests_tax', 128 'menu-item-object-id' => $t, 129 'menu-item-status' => 'publish' 130 ) ); 131 132 $term = get_term( $t, 'wptests_tax' ); 133 134 $menu_items = wp_get_nav_menu_items( $this->menu_id ); 135 $this->assertSame( $term->name, $menu_items[0]->title ); 136 $this->assertEquals( $t, $menu_items[0]->object_id ); 137 } 138 120 139 /** 121 140 * @ticket 29460
Note: See TracChangeset
for help on using the changeset viewer.