Changeset 5111
- Timestamp:
- 03/26/2007 08:08:31 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/classic/index.php
r4495 r5111 9 9 <div class="post" id="post-<?php the_ID(); ?>"> 10 10 <h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3> 11 <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> — <?php the_ author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>11 <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> — <?php the_tags('Tags: ', ', ', ' — '); ?> <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div> 12 12 13 13 <div class="storycontent"> -
trunk/wp-content/themes/default/index.php
r3517 r5111 15 15 </div> 16 16 17 <p class="postmetadata"> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>17 <p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p> 18 18 </div> 19 19 -
trunk/wp-includes/category-template.php
r5090 r5111 161 161 } 162 162 163 function get_post_tags( $post_id = 0 ) { 164 global $tag_cache, $blog_id; 165 166 $post_id = (int) $post_id; 167 168 if ( !isset( $tag_cache[$blog_id][$post_id] ) ) 169 update_post_category_cache( $post_id ); // loads $tag_cache 170 171 return $tag_cache[$blog_id][$post_id]; 172 } 173 174 function get_the_tags( $before, $sep, $after ) { 175 global $post; 176 if ( !$post ) 177 return false; // in-the-loop function 178 179 $tags = get_post_tags( $post->ID ); 180 if ( empty( $tags ) ) 181 return false; 182 183 $return = $before; 184 foreach ( $tags as $tag ) 185 $tag_links[] = '<a href="' . get_category_link($tag->cat_ID) . '">' . $tag->cat_name . '</a>'; 186 187 $tag_links = join( $sep, $tag_links ); 188 $tag_links = apply_filters( 'the_tags', $tag_links ); 189 $return .= $tag_links; 190 191 $return .= $after; 192 return $return; 193 } 194 195 function the_tags( $before = 'Tags: ', $sep = ', ', $after = '' ) { 196 echo get_the_tags( $before, $sep, $after ); 197 } 198 163 199 function category_description($category = 0) { 164 200 global $cat; -
trunk/wp-includes/functions.php
r5109 r5111 636 636 637 637 function update_post_category_cache($post_ids) { 638 global $wpdb, $category_cache, $ blog_id;638 global $wpdb, $category_cache, $tag_cache, $blog_id; 639 639 640 640 if ( empty($post_ids) ) … … 657 657 $post_id_list = join( ',', $post_id_array ); // with already cached stuff removed 658 658 659 $dogs = $wpdb->get_results("SELECT post_id, category_id FROM $wpdb->post2cat WHERE post_id IN ($post_id_list)");659 $dogs = $wpdb->get_results("SELECT post_id, category_id, rel_type FROM $wpdb->post2cat WHERE post_id IN ($post_id_list)"); 660 660 661 661 if ( empty($dogs) ) 662 662 return; 663 663 664 foreach ($dogs as $catt) 665 $category_cache[$blog_id][$catt->post_id][$catt->category_id] = &get_category($catt->category_id); 664 foreach ($dogs as $catt) { 665 if ( 'category' == $catt->rel_type ) 666 $category_cache[$blog_id][$catt->post_id][$catt->category_id] = &get_category($catt->category_id); 667 elseif ( 'tag' == $catt->rel_type ) 668 $tag_cache[$blog_id][$catt->post_id][$catt->category_id] = &get_category($catt->category_id); 669 } 666 670 } 667 671
Note: See TracChangeset
for help on using the changeset viewer.