Make WordPress Core

Ticket #4532: tags_with_attachments_fix.diff

File tags_with_attachments_fix.diff, 1.6 KB (added by filosofo, 18 years ago)
  • wp-includes/taxonomy.php

     
    569569                $select_this = 't.*, tt.*';
    570570        else if ( 'ids' == $fields )
    571571                $select_this = 't.term_id';
     572        else if ( 'names' == $fields )
     573                $select_this = 't.name';
    572574        else if ( 'all_with_object_id' == $fields )
    573575                $select_this = 't.*, tt.*, tr.object_id';
    574576
     
    577579        if ( 'all' == $fields || 'all_with_object_id' == $fields ) {
    578580                $terms = $wpdb->get_results($query);
    579581                update_term_cache($terms);
    580         } else if ( 'ids' == $fields ) {
     582        } else if ( 'ids' == $fields || 'names' == $fields ) {
    581583                $terms = $wpdb->get_col($query);
    582584        } else if ( 'tt_ids' == $fields ) {
    583585                $terms = $wpdb->get_col("SELECT tr.term_taxonomy_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tr.object_id IN ($object_ids) AND tt.taxonomy IN ($taxonomies) ORDER BY tr.term_taxonomy_id $order");
  • wp-includes/post.php

     
    477477
    478478        $post = get_post($postid, $mode);
    479479
    480         // Set categories
     480        // Set categories and tags
    481481        if($mode == OBJECT) {
    482482                $post->post_category = wp_get_post_categories($postid);
     483                $post->tags_input = wp_get_post_tags($postid, array('fields' => 'names'));
    483484        }
    484485        else {
    485486                $post['post_category'] = wp_get_post_categories($postid);
     487                $post['tags_input'] = wp_get_post_tags($postid, array('fields' => 'names'));
    486488        }
    487489
    488490        return $post;