From 42db9e270824a61fde910efc9af8872cafb0861e Mon Sep 17 00:00:00 2001 From: saxmatt Date: Tue, 23 Dec 2003 20:51:04 +0000 Subject: [PATCH] Template tag for category_description and set $cat if you have category_name thing going on. Space out options screen. git-svn-id: http://svn.automattic.com/wordpress/trunk@643 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-blog-header.php | 1 + wp-includes/template-functions.php | 10 +++++++++- wp-includes/vars.php | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/wp-blog-header.php b/wp-blog-header.php index 4bc5f17713..a87bbaf317 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -169,6 +169,7 @@ if ('' != $category_name) { $category_name = preg_replace('|[^a-z0-9-/]|', '', $category_name); $join = " LEFT JOIN $tablepost2cat ON ($tableposts.ID = $tablepost2cat.post_id) LEFT JOIN $tablecategories ON ($tablepost2cat.category_id = $tablecategories.cat_ID) "; $whichcat = " AND (category_nicename = '$category_name') "; + $cat = $wpdb->get_var("SELECT cat_ID FROM $tablecategories WHERE category_nicename = '$category_name'"); } // author stuff diff --git a/wp-includes/template-functions.php b/wp-includes/template-functions.php index ad06e7d32b..5c27ef0f41 100644 --- a/wp-includes/template-functions.php +++ b/wp-includes/template-functions.php @@ -1226,7 +1226,7 @@ function posts_nav_link($sep=' :: ', $prelabel='<< Previous Page', $nxtlabel='Ne function get_the_category() { global $post, $tablecategories, $tablepost2cat, $wpdb; $categories = $wpdb->get_results(" - SELECT category_id, cat_name, category_nicename + SELECT category_id, cat_name, category_nicename, category_description FROM $tablecategories, $tablepost2cat WHERE $tablepost2cat.category_id = cat_ID AND $tablepost2cat.post_id = $post->ID "); @@ -1323,6 +1323,14 @@ function the_category_head($before='', $after='') { } } +function category_description($category = 0) { + global $cat, $wpdb, $tablecategories; + if (!$category) $category = $cat; + $category_description = $wpdb->get_var("SELECT category_description FROM $tablecategories WHERE cat_ID = $category"); + $category_description = apply_filters('category_description', $category_description); + return $category_description; +} + // out of the b2 loop function dropdown_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $optiondates = 0, $optioncount = 0, $hide_empty = 1) { diff --git a/wp-includes/vars.php b/wp-includes/vars.php index bb10421b09..ae5a9bc366 100644 --- a/wp-includes/vars.php +++ b/wp-includes/vars.php @@ -269,9 +269,12 @@ foreach($wpsmiliestrans as $smiley => $img) { $wp_smiliesreplace[] = " $smiley_masked"; } + +// Some default filters add_filter('all', 'wptexturize'); add_filter('the_content', 'wpautop'); add_filter('comment_text', 'wpautop'); + // Uncomment the following for Textile support // include_once('textile.php'); // add_filter('the_content', 'textile');