Changeset 1385 for trunk/wp-includes/template-functions-category.php
- Timestamp:
- 06/04/2004 02:36:46 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/template-functions-category.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/template-functions-category.php
r1375 r1385 1 1 <?php 2 2 3 function get_the_category( ) {3 function get_the_category($id = false) { 4 4 global $post, $wpdb, $category_cache; 5 if ($category_cache[$post->ID]) { 6 return $category_cache[$post->ID]; 5 6 if (! $id) { 7 $id = $post->ID; 8 } 9 10 if ($category_cache[$id]) { 11 return $category_cache[$id]; 7 12 } else { 8 13 $categories = $wpdb->get_results(" 9 14 SELECT category_id, cat_name, category_nicename, category_description, category_parent 10 15 FROM $wpdb->categories, $wpdb->post2cat 11 WHERE $wpdb->post2cat.category_id = cat_ID AND $wpdb->post2cat.post_id = $ post->ID16 WHERE $wpdb->post2cat.category_id = cat_ID AND $wpdb->post2cat.post_id = $id 12 17 "); 13 18
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)