Changeset 57848 for trunk/src/wp-includes/class-wp-walker.php
- Timestamp:
- 03/17/2024 09:54:21 AM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-walker.php
r57648 r57848 148 148 149 149 // Descend only when the depth is right and there are children for this element. 150 if ( ( 0 == $max_depth || $max_depth > $depth + 1 ) && isset( $children_elements[ $id ] ) ) {150 if ( ( 0 === $max_depth || $max_depth > $depth + 1 ) && isset( $children_elements[ $id ] ) ) { 151 151 152 152 foreach ( $children_elements[ $id ] as $child ) { … … 200 200 201 201 // Flat display. 202 if ( -1 == $max_depth ) {202 if ( -1 === $max_depth ) { 203 203 $empty_array = array(); 204 204 foreach ( $elements as $e ) { … … 236 236 $children_elements = array(); 237 237 foreach ( $elements as $e ) { 238 if ( $root->$parent_field == $e->$parent_field ) {238 if ( $root->$parent_field === $e->$parent_field ) { 239 239 $top_level_elements[] = $e; 240 240 } else { … … 252 252 * then we got orphans, which should be displayed regardless. 253 253 */ 254 if ( ( 0 == $max_depth ) && count( $children_elements ) > 0 ) {254 if ( ( 0 === $max_depth ) && count( $children_elements ) > 0 ) { 255 255 $empty_array = array(); 256 256 foreach ( $children_elements as $orphans ) { … … 295 295 296 296 $count = -1; 297 if ( -1 == $max_depth ) {297 if ( -1 === $max_depth ) { 298 298 $total_top = count( $elements ); 299 299 } … … 302 302 $paging = false; 303 303 $start = 0; 304 if ( -1 == $max_depth ) {304 if ( -1 === $max_depth ) { 305 305 $end = $total_top; 306 306 } … … 310 310 $start = ( (int) $page_num - 1 ) * (int) $per_page; 311 311 $end = $start + $per_page; 312 if ( -1 == $max_depth ) {312 if ( -1 === $max_depth ) { 313 313 $this->max_pages = (int) ceil( $total_top / $per_page ); 314 314 } … … 316 316 317 317 // Flat display. 318 if ( -1 == $max_depth ) {318 if ( -1 === $max_depth ) { 319 319 if ( ! empty( $args[0]['reverse_top_level'] ) ) { 320 320 $elements = array_reverse( $elements );
Note: See TracChangeset
for help on using the changeset viewer.