Make WordPress Core

Changeset 6839


Ignore:
Timestamp:
02/14/2008 02:51:12 AM (18 years ago)
Author:
ryan
Message:

Revert [6835] as it breaks the depth arg. see#5844

File:
1 edited

Legend:

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

    r6835 r6839  
    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
    420426                //display this element
    421427                $cb_args = array_merge( array($output, $element, $depth), $args);
     
    427433                        if ( $child->$parent_field == $element->$id_field ) {
    428434
    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                                
    436435                                array_splice( $children_elements, $i, 1 );
    437436                                $output = $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );
     
    440439                }
    441440
    442                 if ( isset($newlevel) && $newlevel ){
     441                //end this element
     442                $cb_args = array_merge( array($output, $element, $depth), $args);
     443                $output = call_user_func_array(array(&$this, 'end_el'), $cb_args);
     444
     445                if ($depth > 0) {
    443446                        //end the child delimiter
    444447                        $cb_args = array_merge( array($output, $depth), $args);
    445448                        $output = call_user_func_array(array(&$this, 'end_lvl'), $cb_args);
    446449                }
    447                
    448                 //end this element
    449                 $cb_args = array_merge( array($output, $element, $depth), $args);
    450                 $output = call_user_func_array(array(&$this, 'end_el'), $cb_args);
    451450
    452451                return $output;
Note: See TracChangeset for help on using the changeset viewer.