From 3a4570b0fc8b3d6339bef71d17d7701554e0bbf7 Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 12 Oct 2007 16:21:15 +0000 Subject: Merge with WP 2.3 - testing use only! Move pluggable functions out of wpmu-functions and into pluggable.php, fixes #439 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1069 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/classes.php | 68 ++++++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 32 deletions(-) (limited to 'wp-includes/classes.php') diff --git a/wp-includes/classes.php b/wp-includes/classes.php index dd05256..6e55c45 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -1,9 +1,9 @@ public_query_vars[] = $qv; } + function set_query_var($key, $value) { + $this->query_vars[$key] = $value; + } + function parse_request($extra_query_vars = '') { global $wp_rewrite; @@ -176,9 +180,9 @@ class WP { status_header( 404 ); if ( !is_user_logged_in() ) nocache_headers(); - @header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); + @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); } else if ( empty($this->query_vars['feed']) ) { - @header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); + @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); } else { // We're showing a feed, so WP is indeed the only thing that last changed if ( $this->query_vars['withcomments'] @@ -507,10 +511,10 @@ class Walker_Page extends Walker { if ( $depth ) $indent = str_repeat("\t", $depth); extract($args, EXTR_SKIP); - $css_class = 'page_item'; + $css_class = 'page_item page-item-'.$page->ID; $_current_page = get_page( $current_page ); if ( $page->ID == $current_page ) - $css_class .= ' current_page_item'; + $css_class .= ' current_page_item '; elseif ( $_current_page && $page->ID == $_current_page->post_parent ) $css_class .= ' current_page_parent'; @@ -557,7 +561,7 @@ class Walker_PageDropdown extends Walker { class Walker_Category extends Walker { var $tree_type = 'category'; - var $db_fields = array ('parent' => 'category_parent', 'id' => 'cat_ID'); //TODO: decouple this + var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this function start_lvl($output, $depth, $args) { if ( 'list' != $args['style'] ) @@ -580,13 +584,13 @@ class Walker_Category extends Walker { function start_el($output, $category, $depth, $args) { extract($args); - $cat_name = attribute_escape( $category->cat_name); + $cat_name = attribute_escape( $category->name); $cat_name = apply_filters( 'list_cats', $cat_name, $category ); - $link = 'category_description) ) + $link = 'description) ) $link .= 'title="' . sprintf(__( 'View all posts filed under %s' ), $cat_name) . '"'; else - $link .= 'title="' . attribute_escape( apply_filters( 'category_description', $category->category_description, $category )) . '"'; + $link .= 'title="' . attribute_escape( apply_filters( 'category_description', $category->description, $category )) . '"'; $link .= '>'; $link .= $cat_name . ''; @@ -596,7 +600,7 @@ class Walker_Category extends Walker { if ( empty($feed_image) ) $link .= '('; - $link .= 'term_id, $category->slug ) . '"'; if ( empty($feed) ) $alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"'; @@ -619,7 +623,7 @@ class Walker_Category extends Walker { } if ( isset($show_count) && $show_count ) - $link .= ' (' . intval($category->category_count) . ')'; + $link .= ' (' . intval($category->count) . ')'; if ( isset($show_date) && $show_date ) { $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp); @@ -630,10 +634,12 @@ class Walker_Category extends Walker { if ( 'list' == $args['style'] ) { $output .= "\tcat_ID == $current_category) ) - $output .= ' class="current-cat"'; - elseif ( $_current_category && ($category->cat_ID == $_current_category->category_parent) ) - $output .= ' class="current-cat-parent"'; + $class = 'cat-item cat-item-'.$category->term_id; + if ( $current_category && ($category->term_id == $current_category) ) + $class .= ' current-cat'; + elseif ( $_current_category && ($category->term_id == $_current_category->parent) ) + $class .= ' current-cat-parent'; + $output .= ' class="'.$class.'"'; $output .= ">$link\n"; } else { $output .= "\t$link
\n"; @@ -654,19 +660,19 @@ class Walker_Category extends Walker { class Walker_CategoryDropdown extends Walker { var $tree_type = 'category'; - var $db_fields = array ('parent' => 'category_parent', 'id' => 'cat_ID'); //TODO: decouple this + var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this function start_el($output, $category, $depth, $args) { $pad = str_repeat(' ', $depth * 3); - $cat_name = apply_filters('list_cats', $category->cat_name, $category); - $output .= "\t