Make WordPress Core


Ignore:
Timestamp:
12/23/2003 08:51:04 PM (22 years ago)
Author:
saxmatt
Message:

Template tag for category_description and set $cat if you have category_name thing going on. Space out options screen.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/template-functions.php

    r640 r643  
    12271227    global $post, $tablecategories, $tablepost2cat, $wpdb;
    12281228    $categories = $wpdb->get_results("
    1229         SELECT category_id, cat_name, category_nicename
     1229        SELECT category_id, cat_name, category_nicename, category_description
    12301230        FROM  $tablecategories, $tablepost2cat
    12311231        WHERE $tablepost2cat.category_id = cat_ID AND $tablepost2cat.post_id = $post->ID
     
    13221322        $previouscat = $currentcat;
    13231323    }
     1324}
     1325
     1326function category_description($category = 0) {
     1327    global $cat, $wpdb, $tablecategories;
     1328    if (!$category) $category = $cat;
     1329    $category_description = $wpdb->get_var("SELECT category_description FROM $tablecategories WHERE cat_ID = $category");
     1330    $category_description = apply_filters('category_description', $category_description);
     1331    return $category_description;
    13241332}
    13251333
Note: See TracChangeset for help on using the changeset viewer.