Make WordPress Core

Ticket #4703: walker-classes.diff

File walker-classes.diff, 1.4 KB (added by Otto42, 18 years ago)

Adds classes for page and category items

  • wp-includes/classes.php

     
    507507                if ( $depth )
    508508                        $indent = str_repeat("\t", $depth);
    509509                extract($args, EXTR_SKIP);
    510                 $css_class = 'page_item';
     510                $css_class = 'page_item page_item_'.$page->ID;
    511511                $_current_page = get_page( $current_page );
    512512                if ( $page->ID == $current_page )
    513513                        $css_class .= ' current_page_item';
     
    630630
    631631                if ( 'list' == $args['style'] ) {
    632632                        $output .= "\t<li";
     633                        $class = 'cat_item cat_item_'.$category->term_id;
    633634                        if ( $current_category && ($category->term_id == $current_category) )
    634                                 $output .=  ' class="current-cat"';
     635                                $class .=  ' current-cat';
    635636                        elseif ( $_current_category && ($category->term_id == $_current_category->parent) )
    636                                 $output .=  ' class="current-cat-parent"';
     637                                $class .=  ' current-cat-parent';
     638                        $output .=  ' class="'.$class.'"';
    637639                        $output .= ">$link\n";
    638640                } else {
    639641                        $output .= "\t$link<br />\n";
     
    688690        // a WP_Error object can be passed in 'id' or 'data'
    689691        function add( $args = '' ) {
    690692                $defaults = array(
    691                         'what' => 'object', 'action' => false, 
    692                         'id' => '0', 'old_id' => false, 
     693                        'what' => 'object', 'action' => false,
     694                        'id' => '0', 'old_id' => false,
    693695                        'data' => '', 'supplemental' => array()
    694696                );
    695697