~canonical-sysadmins/wordpress/4.5.2

« back to all changes in this revision

Viewing changes to wp-includes/class-wp-walker.php

  • Committer: Manuel Seelaus
  • Date: 2015-12-09 17:47:18 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: manuel.seelaus@canonical.com-20151209174718-coxethm2swbeqksy
Merge WP4.4 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
                // descend only when the depth is right and there are childrens for this element
149
149
                if ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) {
150
150
 
151
 
                        foreach( $children_elements[ $id ] as $child ){
 
151
                        foreach ( $children_elements[ $id ] as $child ){
152
152
 
153
153
                                if ( !isset($newlevel) ) {
154
154
                                        $newlevel = true;
250
250
                if ( ( $max_depth == 0 ) && count( $children_elements ) > 0 ) {
251
251
                        $empty_array = array();
252
252
                        foreach ( $children_elements as $orphans )
253
 
                                foreach( $orphans as $op )
 
253
                                foreach ( $orphans as $op )
254
254
                                        $this->display_element( $op, $empty_array, 1, 0, $args, $output );
255
255
                 }
256
256
 
374
374
                if ( $end >= $total_top && count( $children_elements ) > 0 ) {
375
375
                        $empty_array = array();
376
376
                        foreach ( $children_elements as $orphans )
377
 
                                foreach( $orphans as $op )
 
377
                                foreach ( $orphans as $op )
378
378
                                        $this->display_element( $op, $empty_array, 1, 0, $args, $output );
379
379
                }
380
380
 
382
382
        }
383
383
 
384
384
        /**
 
385
         * Calculates the total number of root elements.
385
386
         *
386
 
         * @param array $elements
387
 
         * @return int
 
387
         * @since 2.7.0
 
388
         * @access public
 
389
         * 
 
390
         * @param array $elements Elements to list.
 
391
         * @return int Number of root elements.
388
392
         */
389
393
        public function get_number_of_root_elements( $elements ){
390
394
                $num = 0;