From aae5b160f307adf0703ae8f7c2b158b91570ec95 Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 1 Dec 2006 12:27:29 +0000 Subject: WP Merge to 4578, except for script-loader git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@817 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/classes.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'wp-includes/classes.php') diff --git a/wp-includes/classes.php b/wp-includes/classes.php index 966e42e..f60b50d 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -430,6 +430,9 @@ class Walker { if ( !$to_depth || ($depth < $to_depth) ) { //only descend if we're below $to_depth $cb_args = array_merge( array($output, $depth - 1), $args); $output = call_user_func_array(array(&$this, 'start_lvl'), $cb_args); + } else { // If we've reached depth, end the previous element. + $cb_args = array_merge( array($output, $previous_element, $depth - 1), $args); + $output = call_user_func_array(array(&$this, 'end_el'), $cb_args); } } else if ( $element->$parent_field == $previous_element->$parent_field) { // On the same level as previous element. @@ -500,8 +503,11 @@ class Walker_Page extends Walker { $indent = str_repeat("\t", $depth); $css_class = 'page_item'; + $_current_page = get_page( $current_page ); if ( $page->ID == $current_page ) $css_class .= ' current_page_item'; + elseif ( $_current_page && $page->ID == $_current_page->post_parent ) + $css_class .= ' current_page_parent'; $output .= $indent . '
  • ' . $page->post_title . ''; @@ -609,11 +615,15 @@ class Walker_Category extends Walker { if ( isset($show_date) && $show_date ) { $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp); } - + + $_current_category = get_category( $current_category ); + if ( 'list' == $args['style'] ) { $output .= "\tcat_ID == $current_category) && is_category() ) $output .= ' class="current-cat"'; + elseif ( ($category->cat_ID == $_current_category->category_parent) && is_category() ) + $output .= ' class="current-cat-parent"'; $output .= ">$link\n"; } else { $output .= "\t$link
    \n"; -- cgit