Make WordPress Core

Changeset 643


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.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-blog-header.php

    r628 r643  
    170170    $join = " LEFT JOIN $tablepost2cat ON ($tableposts.ID = $tablepost2cat.post_id) LEFT JOIN $tablecategories ON ($tablepost2cat.category_id = $tablecategories.cat_ID) ";
    171171    $whichcat = " AND (category_nicename = '$category_name') ";
     172    $cat = $wpdb->get_var("SELECT cat_ID FROM $tablecategories WHERE category_nicename = '$category_name'");
    172173}
    173174
  • 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
  • trunk/wp-includes/vars.php

    r629 r643  
    270270}
    271271
     272
     273// Some default filters
    272274add_filter('all', 'wptexturize');
    273275add_filter('the_content', 'wpautop');
    274276add_filter('comment_text', 'wpautop');
     277
    275278// Uncomment the following for Textile support
    276279// include_once('textile.php');
Note: See TracChangeset for help on using the changeset viewer.