diff --git a/wp-blog-header.php b/wp-blog-header.php index 4bc5f1771..a87bbaf31 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 ad06e7d32..5c27ef0f4 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 bb10421b0..ae5a9bc36 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');