Changeset 5529 for trunk/wp-includes/category-template.php
- Timestamp:
- 05/23/2007 06:07:53 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/category-template.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/category-template.php
r5521 r5529 13 13 14 14 $category = get_category($cat_id); 15 if ( $category-> category_parent == $id ) {16 $chain .= $before.$category-> cat_ID.$after;17 $chain .= get_category_children($category-> cat_ID, $before, $after);15 if ( $category->parent == $id ) { 16 $chain .= $before.$category->term_id.$after; 17 $chain .= get_category_children($category->term_id, $before, $after); 18 18 } 19 19 } … … 30 30 } else { 31 31 $category = &get_category($category_id); 32 $category_nicename = $category-> category_nicename;33 34 if ( $parent = $category-> category_parent )32 $category_nicename = $category->slug; 33 34 if ( $parent = $category->parent ) 35 35 $category_nicename = get_category_parents($parent, false, '/', true) . $category_nicename; 36 36 … … 46 46 47 47 if ( $nicename ) 48 $name = $parent-> category_nicename;48 $name = $parent->slug; 49 49 else 50 50 $name = $parent->cat_name; 51 51 52 if ( $parent-> category_parent && ($parent->category_parent != $parent->cat_ID) )53 $chain .= get_category_parents($parent-> category_parent, $link, $separator, $nicename);52 if ( $parent->parent && ($parent->parent != $parent->term_id) ) 53 $chain .= get_category_parents($parent->parent, $link, $separator, $nicename); 54 54 55 55 if ( $link ) 56 $chain .= '<a href="' . get_category_link($parent-> cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $parent->cat_name) . '">'.$name.'</a>' . $separator;56 $chain .= '<a href="' . get_category_link($parent->term_id) . '" title="' . sprintf(__("View all posts in %s"), $parent->cat_name) . '">'.$name.'</a>' . $separator; 57 57 else 58 58 $chain .= $name.$separator; … … 61 61 62 62 function get_the_category($id = false) { 63 global $post, $category_cache, $blog_id;63 global $post, $category_cache, $blog_id; 64 64 65 65 $id = (int) $id; … … 67 67 $id = (int) $post->ID; 68 68 69 if ( !isset($category_cache[$blog_id][$id]) ) 70 update_post_category_cache($id); 71 72 $categories = $category_cache[$blog_id][$id]; 69 $categories = get_object_terms($id, 'category'); 73 70 74 71 if ( !empty($categories) ) … … 87 84 $cat_ID = (int) $cat_ID; 88 85 $category = &get_category($cat_ID); 89 return $category-> cat_name;86 return $category->name; 90 87 } 91 88 … … 105 102 switch ( strtolower($parents) ) { 106 103 case 'multiple': 107 if ($category-> category_parent)108 $thelist .= get_category_parents($category-> category_parent, TRUE);109 $thelist .= '<a href="' . get_category_link($category-> cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '>' . $category->cat_name.'</a></li>';104 if ($category->parent) 105 $thelist .= get_category_parents($category->parent, TRUE); 106 $thelist .= '<a href="' . get_category_link($category->term_id) . '" title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . $rel . '>' . $category->name.'</a></li>'; 110 107 break; 111 108 case 'single': 112 $thelist .= '<a href="' . get_category_link($category-> cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '>';113 if ($category-> category_parent)114 $thelist .= get_category_parents($category-> category_parent, FALSE);115 $thelist .= $category-> cat_name.'</a></li>';109 $thelist .= '<a href="' . get_category_link($category->term_id) . '" title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . $rel . '>'; 110 if ($category->parent) 111 $thelist .= get_category_parents($category->parent, FALSE); 112 $thelist .= $category->name.'</a></li>'; 116 113 break; 117 114 case '': 118 115 default: 119 $thelist .= '<a href="' . get_category_link($category-> cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '>' . $category->cat_name.'</a></li>';116 $thelist .= '<a href="' . get_category_link($category->term_id) . '" title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . $rel . '>' . $category->cat_name.'</a></li>'; 120 117 } 121 118 } … … 128 125 switch ( strtolower($parents) ) { 129 126 case 'multiple': 130 if ( $category-> category_parent )131 $thelist .= get_category_parents($category-> category_parent, TRUE);132 $thelist .= '<a href="' . get_category_link($category-> cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '>' . $category->cat_name.'</a>';127 if ( $category->parent ) 128 $thelist .= get_category_parents($category->parent, TRUE); 129 $thelist .= '<a href="' . get_category_link($category->term_id) . '" title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . $rel . '>' . $category->cat_name.'</a>'; 133 130 break; 134 131 case 'single': 135 $thelist .= '<a href="' . get_category_link($category-> cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '>';136 if ( $category-> category_parent )137 $thelist .= get_category_parents($category-> category_parent, FALSE);132 $thelist .= '<a href="' . get_category_link($category->term_id) . '" title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . $rel . '>'; 133 if ( $category->parent ) 134 $thelist .= get_category_parents($category->parent, FALSE); 138 135 $thelist .= "$category->cat_name</a>"; 139 136 break; 140 137 case '': 141 138 default: 142 $thelist .= '<a href="' . get_category_link($category-> cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '>' . $category->cat_name.'</a>';139 $thelist .= '<a href="' . get_category_link($category->term_id) . '" title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . $rel . '>' . $category->name.'</a>'; 143 140 } 144 141 ++$i; … … 166 163 $category = $cat; 167 164 $category = & get_category($category); 168 return apply_filters('category_description', $category-> category_description, $category->cat_ID);165 return apply_filters('category_description', $category->description, $category->term_id); 169 166 } 170 167
Note: See TracChangeset
for help on using the changeset viewer.