Make WordPress Core


Ignore:
Timestamp:
02/09/2020 04:52:28 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use Yoda conditions where appropriate.

See #49222.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-walker.php

    r47122 r47219  
    145145
    146146        // Descend only when the depth is right and there are childrens for this element.
    147         if ( ( $max_depth == 0 || $max_depth > $depth + 1 ) && isset( $children_elements[ $id ] ) ) {
     147        if ( ( 0 == $max_depth || $max_depth > $depth + 1 ) && isset( $children_elements[ $id ] ) ) {
    148148
    149149            foreach ( $children_elements[ $id ] as $child ) {
     
    249249         * then we got orphans, which should be displayed regardless.
    250250         */
    251         if ( ( $max_depth == 0 ) && count( $children_elements ) > 0 ) {
     251        if ( ( 0 == $max_depth ) && count( $children_elements ) > 0 ) {
    252252            $empty_array = array();
    253253            foreach ( $children_elements as $orphans ) {
Note: See TracChangeset for help on using the changeset viewer.