Make WordPress Core

Ticket #37368: 37368.diff

File 37368.diff, 1.0 KB (added by codemovement.pk, 9 years ago)
  • taxonomy.php

     
    175175 */
    176176function get_object_taxonomies( $object, $output = 'names' ) {
    177177        global $wp_taxonomies;
    178 
     178        $taxonomies = array();
     179       
    179180        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                }
    182191                $object = $object->post_type;
    183192        }
    184193
    185194        $object = (array) $object;
    186195
    187         $taxonomies = array();
    188196        foreach ( (array) $wp_taxonomies as $tax_name => $tax_obj ) {
    189197                if ( array_intersect($object, (array) $tax_obj->object_type) ) {
    190198                        if ( 'names' == $output )