Changeset 41038 for branches/4.8
- Timestamp:
- 07/13/2017 01:42:44 PM (7 years ago)
- Location:
- branches/4.8
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.8
-
branches/4.8/src/wp-includes/taxonomy.php
r40513 r41038 1865 1865 $args['object_ids'] = $object_ids; 1866 1866 1867 $terms = array_merge( $terms, get_terms( $args ) ); 1867 // Taxonomies registered without an 'args' param are handled here. 1868 if ( ! empty( $taxonomies ) ) { 1869 $terms = array_merge( $terms, get_terms( $args ) ); 1870 } 1868 1871 1869 1872 /** -
branches/4.8/tests/phpunit/tests/term/wpGetObjectTerms.php
r40290 r41038 733 733 $this->assertEquals( array( $t1, $t3, $t2 ), $found ); 734 734 } 735 736 /** 737 * @ticket 41010 738 */ 739 public function test_duplicate_terms_should_not_be_returned_when_passed_multiple_taxonomies_registered_with_args_array() { 740 $taxonomy1 = 'wptests_tax'; 741 $taxonomy2 = 'wptests_tax_2'; 742 743 // Any non-empty 'args' array triggers the bug. 744 $taxonomy_arguments = array( 745 'args' => array( 0 ), 746 ); 747 748 register_taxonomy( $taxonomy1, 'post', $taxonomy_arguments ); 749 register_taxonomy( $taxonomy2, 'post', $taxonomy_arguments ); 750 751 $post_id = self::factory()->post->create(); 752 $term_1_id = self::factory()->term->create( array( 753 'taxonomy' => $taxonomy1, 754 ) ); 755 $term_2_id = self::factory()->term->create( array( 756 'taxonomy' => $taxonomy2, 757 ) ); 758 759 wp_set_object_terms( $post_id, $term_1_id, $taxonomy1 ); 760 wp_set_object_terms( $post_id, $term_2_id, $taxonomy2 ); 761 762 $expected = array( $term_1_id, $term_2_id ); 763 764 $actual = wp_get_object_terms( $post_id, array( $taxonomy1, $taxonomy2 ), array( 765 'orderby' => 'term_id', 766 'fields' => 'ids', 767 ) ); 768 769 $this->assertEqualSets( $expected, $actual ); 770 } 735 771 }
Note: See TracChangeset
for help on using the changeset viewer.