Changeset 41037
- Timestamp:
- 07/13/2017 01:40:39 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r40994 r41037 1918 1918 $args['object_ids'] = $object_ids; 1919 1919 1920 $terms = array_merge( $terms, get_terms( $args ) ); 1920 // Taxonomies registered without an 'args' param are handled here. 1921 if ( ! empty( $taxonomies ) ) { 1922 $terms = array_merge( $terms, get_terms( $args ) ); 1923 } 1921 1924 1922 1925 /** -
trunk/tests/phpunit/tests/term/wpGetObjectTerms.php
r40994 r41037 761 761 return $args; 762 762 } 763 764 /** 765 * @ticket 41010 766 */ 767 public function test_duplicate_terms_should_not_be_returned_when_passed_multiple_taxonomies_registered_with_args_array() { 768 $taxonomy1 = 'wptests_tax'; 769 $taxonomy2 = 'wptests_tax_2'; 770 771 // Any non-empty 'args' array triggers the bug. 772 $taxonomy_arguments = array( 773 'args' => array( 0 ), 774 ); 775 776 register_taxonomy( $taxonomy1, 'post', $taxonomy_arguments ); 777 register_taxonomy( $taxonomy2, 'post', $taxonomy_arguments ); 778 779 $post_id = self::factory()->post->create(); 780 $term_1_id = self::factory()->term->create( array( 781 'taxonomy' => $taxonomy1, 782 ) ); 783 $term_2_id = self::factory()->term->create( array( 784 'taxonomy' => $taxonomy2, 785 ) ); 786 787 wp_set_object_terms( $post_id, $term_1_id, $taxonomy1 ); 788 wp_set_object_terms( $post_id, $term_2_id, $taxonomy2 ); 789 790 $expected = array( $term_1_id, $term_2_id ); 791 792 $actual = wp_get_object_terms( $post_id, array( $taxonomy1, $taxonomy2 ), array( 793 'orderby' => 'term_id', 794 'fields' => 'ids', 795 ) ); 796 797 $this->assertEqualSets( $expected, $actual ); 798 } 763 799 }
Note: See TracChangeset
for help on using the changeset viewer.