Ticket #37368: 37368.diff
File 37368.diff, 1.0 KB (added by , 9 years ago) |
---|
-
taxonomy.php
175 175 */ 176 176 function get_object_taxonomies( $object, $output = 'names' ) { 177 177 global $wp_taxonomies; 178 178 $taxonomies = array(); 179 179 180 if ( is_object($object) ) { 180 if ( $object->post_type == 'attachment' ) 181 return get_attachment_taxonomies($object); 181 if ( $object->post_type == 'attachment' ){ 182 $attachment_taxonomies = get_attachment_taxonomies($object); 183 foreach ( $attachment_taxonomies as $attachment_tax ) { 184 if ( 'names' == $output ) 185 $taxonomies[] = $attachment_tax; 186 else 187 $taxonomies[ $attachment_tax ] = $wp_taxonomies[$attachment_tax]; 188 } 189 return $taxonomies; 190 } 182 191 $object = $object->post_type; 183 192 } 184 193 185 194 $object = (array) $object; 186 195 187 $taxonomies = array();188 196 foreach ( (array) $wp_taxonomies as $tax_name => $tax_obj ) { 189 197 if ( array_intersect($object, (array) $tax_obj->object_type) ) { 190 198 if ( 'names' == $output )