diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-12-01 12:27:29 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-12-01 12:27:29 +0000 |
commit | aae5b160f307adf0703ae8f7c2b158b91570ec95 (patch) | |
tree | ba0d1eee6e2eedfe3fd0a693d773162ab9dc8a67 /wp-includes/classes.php | |
parent | 9415bbca12c01c39da58e0ed2c4e6b44ff833e5d (diff) | |
download | wordpress-mu-aae5b160f307adf0703ae8f7c2b158b91570ec95.tar.gz wordpress-mu-aae5b160f307adf0703ae8f7c2b158b91570ec95.tar.xz wordpress-mu-aae5b160f307adf0703ae8f7c2b158b91570ec95.zip |
WP Merge to 4578, except for script-loader
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@817 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/classes.php')
-rw-r--r-- | wp-includes/classes.php | 12 |
1 files changed, 11 insertions, 1 deletions
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 . '<li class="' . $css_class . '"><a href="' . get_page_link($page->ID) . '" title="' . wp_specialchars($page->post_title, 1) . '">' . $page->post_title . '</a>'; @@ -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 .= "\t<li"; if ( ($category->cat_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<br />\n"; |