Make WordPress Core

Ticket #18968: 18968-r25222.patch

File 18968-r25222.patch, 1.4 KB (added by jeffstieler, 12 years ago)
  • wp-admin/includes/taxonomy.php

     
    219219        if ( !$post_id )
    220220                return false;
    221221
    222         $tags = wp_get_post_terms($post_id, $taxonomy, array());
     222        $tags = get_the_terms( $post_id, $taxonomy );
    223223
    224224        if ( !$tags )
    225225                return false;
  • wp-admin/includes/template.php

     
    275275                $taxonomy = get_taxonomy( $taxonomy_name );
    276276
    277277                if ( $taxonomy->hierarchical && $taxonomy->show_ui ) {
    278                                 echo '<div class="post_category" id="' . $taxonomy_name . '_' . $post->ID . '">'
    279                                         . implode( ',', wp_get_object_terms( $post->ID, $taxonomy_name, array( 'fields' => 'ids' ) ) ) . '</div>';
     278
     279                        $terms    = get_the_terms( $post->ID, $taxonomy_name );
     280                        $term_ids = empty( $terms ) ? array() : wp_list_pluck( $terms, 'term_id' );
     281
     282                        echo '<div class="post_category" id="' . $taxonomy_name . '_' . $post->ID . '">' . implode( ',', $term_ids ) . '</div>';
     283
    280284                } elseif ( $taxonomy->show_ui ) {
     285
    281286                        echo '<div class="tags_input" id="'.$taxonomy_name.'_'.$post->ID.'">'
    282287                                . esc_html( str_replace( ',', ', ', get_terms_to_edit( $post->ID, $taxonomy_name ) ) ) . '</div>';
     288
    283289                }
    284290        }
    285291