Changeset 38437
- Timestamp:
- 08/30/2016 03:06:06 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r38411 r38437 2750 2750 } 2751 2751 2752 return array_unique($taxonomies); 2752 if ( 'names' === $output ) { 2753 $taxonomies = array_unique( $taxonomies ); 2754 } 2755 2756 return $taxonomies; 2753 2757 } 2754 2758 -
trunk/tests/phpunit/tests/media/getAttachmentTaxonomies.php
r38292 r38437 99 99 $this->assertSame( 'wptests_tax2', $found['wptests_tax2']->name ); 100 100 } 101 102 103 /** 104 * @ticket 37368 105 */ 106 public function test_should_return_unique_taxonomies_for_output_objects() { 107 register_taxonomy( 'wptests_tax2', array( 'attachment:image', 'attachment:image/jpeg' ) ); 108 109 $a = self::factory()->attachment->create_object( 'image.jpg', 0, array( 110 'post_mime_type' => 'image/jpeg', 111 'post_type' => 'attachment' 112 ) ); 113 $attachment = get_post( $a ); 114 115 $found = get_attachment_taxonomies( $attachment, 'objects' ); 116 117 $this->assertSame( array( 'wptests_tax2' ), array_keys( $found ) ); 118 $this->assertInternalType( 'object', $found['wptests_tax2'] ); 119 $this->assertSame( 'wptests_tax2', $found['wptests_tax2']->name ); 120 } 101 121 }
Note: See TracChangeset
for help on using the changeset viewer.