Make WordPress Core


Ignore:
Timestamp:
04/21/2008 07:30:54 PM (18 years ago)
Author:
ryan
Message:

Convert Walker classes to pass as reference. Props mdawaffe. fixes #6796 for trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r7745 r7761  
    127127    var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this
    128128
    129     function start_lvl($output, $depth, $args) {
     129    function start_lvl(&$output, $depth, $args) {
    130130        $indent = str_repeat("\t", $depth);
    131131        $output .= "$indent<ul class='children'>\n";
    132         return $output;
    133     }
    134 
    135     function end_lvl($output, $depth, $args) {
     132    }
     133
     134    function end_lvl(&$output, $depth, $args) {
    136135        $indent = str_repeat("\t", $depth);
    137136        $output .= "$indent</ul>\n";
    138         return $output;
    139     }
    140 
    141     function start_el($output, $category, $depth, $args) {
     137    }
     138
     139    function start_el(&$output, $category, $depth, $args) {
    142140        extract($args);
    143141
    144142        $class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : '';
    145143        $output .= "\n<li id='category-$category->term_id'$class>" . '<label for="in-category-' . $category->term_id . '" class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="post_category[]" id="in-category-' . $category->term_id . '"' . (in_array( $category->term_id, $selected_cats ) ? ' checked="checked"' : "" ) . '/> ' . wp_specialchars( apply_filters('the_category', $category->name )) . '</label>';
    146 
    147         return $output;
    148     }
    149 
    150     function end_el($output, $category, $depth, $args) {
    151         if ( 'list' != $args['style'] )
    152             return $output;
    153 
     144    }
     145
     146    function end_el(&$output, $category, $depth, $args) {
    154147        $output .= "</li>\n";
    155         return $output;
    156148    }
    157149}
Note: See TracChangeset for help on using the changeset viewer.