From dac74f6c47dccb4d6033c20c8ea64d2dadd0a249 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 22 Aug 2007 22:59:45 +0000 Subject: [PATCH] Add cat-item-id and page-item-id classes. Props Otto42. fixes #4703 git-svn-id: https://develop.svn.wordpress.org/trunk@5920 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/classes.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/wp-includes/classes.php b/wp-includes/classes.php index dc031e0b68..f1798e3d01 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -511,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'; @@ -634,10 +634,12 @@ class Walker_Category extends Walker { if ( 'list' == $args['style'] ) { $output .= "\tterm_id; if ( $current_category && ($category->term_id == $current_category) ) - $output .= ' class="current-cat"'; + $class .= ' current-cat'; elseif ( $_current_category && ($category->term_id == $_current_category->parent) ) - $output .= ' class="current-cat-parent"'; + $class .= ' current-cat-parent'; + $output .= ' class="'.$class.'"'; $output .= ">$link\n"; } else { $output .= "\t$link
\n"; @@ -692,8 +694,8 @@ class WP_Ajax_Response { // a WP_Error object can be passed in 'id' or 'data' function add( $args = '' ) { $defaults = array( - 'what' => 'object', 'action' => false, - 'id' => '0', 'old_id' => false, + 'what' => 'object', 'action' => false, + 'id' => '0', 'old_id' => false, 'data' => '', 'supplemental' => array() );