WordPress.org

Make WordPress Core

Changeset 5920


Ignore:
Timestamp:
08/22/07 22:59:45 (10 years ago)
Author:
ryan
Message:

Add cat-item-id and page-item-id classes. Props Otto42. fixes #4703

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r5873 r5920  
    512512            $indent = str_repeat("\t", $depth); 
    513513        extract($args, EXTR_SKIP); 
    514         $css_class = 'page_item'; 
     514        $css_class = 'page_item page-item-'.$page->ID; 
    515515        $_current_page = get_page( $current_page ); 
    516516        if ( $page->ID == $current_page ) 
    517             $css_class .= ' current_page_item'; 
     517            $css_class .= ' current_page_item '; 
    518518        elseif ( $_current_page && $page->ID == $_current_page->post_parent ) 
    519519            $css_class .= ' current_page_parent'; 
     
    635635        if ( 'list' == $args['style'] ) { 
    636636            $output .= "\t<li"; 
     637            $class = 'cat-item cat-item-'.$category->term_id; 
    637638            if ( $current_category && ($category->term_id == $current_category) ) 
    638                 $output .=  ' class="current-cat"'; 
     639                $class .=  ' current-cat'; 
    639640            elseif ( $_current_category && ($category->term_id == $_current_category->parent) ) 
    640                 $output .=  ' class="current-cat-parent"'; 
     641                $class .=  ' current-cat-parent'; 
     642            $output .=  ' class="'.$class.'"'; 
    641643            $output .= ">$link\n"; 
    642644        } else { 
     
    693695    function add( $args = '' ) { 
    694696        $defaults = array( 
    695             'what' => 'object', 'action' => false,  
    696             'id' => '0', 'old_id' => false,  
     697            'what' => 'object', 'action' => false, 
     698            'id' => '0', 'old_id' => false, 
    697699            'data' => '', 'supplemental' => array() 
    698700        ); 
Note: See TracChangeset for help on using the changeset viewer.