Changeset 6835

Show
Ignore:
Timestamp:
02/14/08 00:54:52 (7 months ago)
Author:
ryan
Message:

Walker markup fixes from hailin. fixes #5844

Files:

Legend:

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

    r6726 r6835  
    418418        $parent_field = $this->db_fields['parent']; 
    419419 
    420         if ($depth > 0) { 
    421             //start the child delimiter 
    422             $cb_args = array_merge( array($output, $depth), $args); 
    423             $output = call_user_func_array(array(&$this, 'start_lvl'), $cb_args); 
    424         } 
    425  
    426420        //display this element 
    427421        $cb_args = array_merge( array($output, $element, $depth), $args); 
     
    433427            if ( $child->$parent_field == $element->$id_field ) { 
    434428 
     429                if ( !isset($newlevel) ) { 
     430                    $newlevel = true;  
     431                    //start the child delimiter 
     432                    $cb_args = array_merge( array($output, $depth), $args); 
     433                    $output = call_user_func_array(array(&$this, 'start_lvl'), $cb_args); 
     434                } 
     435                 
    435436                array_splice( $children_elements, $i, 1 ); 
    436437                $output = $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output ); 
     
    439440        } 
    440441 
     442        if ( isset($newlevel) && $newlevel ){ 
     443            //end the child delimiter 
     444            $cb_args = array_merge( array($output, $depth), $args); 
     445            $output = call_user_func_array(array(&$this, 'end_lvl'), $cb_args); 
     446        } 
     447         
    441448        //end this element 
    442449        $cb_args = array_merge( array($output, $element, $depth), $args); 
    443450        $output = call_user_func_array(array(&$this, 'end_el'), $cb_args); 
    444  
    445         if ($depth > 0) { 
    446             //end the child delimiter 
    447             $cb_args = array_merge( array($output, $depth), $args); 
    448             $output = call_user_func_array(array(&$this, 'end_lvl'), $cb_args); 
    449         } 
    450451 
    451452        return $output;