Ticket #4532: tags_with_attachments_fix.diff
File tags_with_attachments_fix.diff, 1.6 KB (added by , 18 years ago) |
---|
-
wp-includes/taxonomy.php
569 569 $select_this = 't.*, tt.*'; 570 570 else if ( 'ids' == $fields ) 571 571 $select_this = 't.term_id'; 572 else if ( 'names' == $fields ) 573 $select_this = 't.name'; 572 574 else if ( 'all_with_object_id' == $fields ) 573 575 $select_this = 't.*, tt.*, tr.object_id'; 574 576 … … 577 579 if ( 'all' == $fields || 'all_with_object_id' == $fields ) { 578 580 $terms = $wpdb->get_results($query); 579 581 update_term_cache($terms); 580 } else if ( 'ids' == $fields ) {582 } else if ( 'ids' == $fields || 'names' == $fields ) { 581 583 $terms = $wpdb->get_col($query); 582 584 } else if ( 'tt_ids' == $fields ) { 583 585 $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
477 477 478 478 $post = get_post($postid, $mode); 479 479 480 // Set categories 480 // Set categories and tags 481 481 if($mode == OBJECT) { 482 482 $post->post_category = wp_get_post_categories($postid); 483 $post->tags_input = wp_get_post_tags($postid, array('fields' => 'names')); 483 484 } 484 485 else { 485 486 $post['post_category'] = wp_get_post_categories($postid); 487 $post['tags_input'] = wp_get_post_tags($postid, array('fields' => 'names')); 486 488 } 487 489 488 490 return $post;