Make WordPress Core


Ignore:
Timestamp:
02/09/2020 04:52:28 PM (7 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/category.php

    r47122 r47219  
    128128        $full_path      = '';
    129129        foreach ( (array) $category_paths as $pathdir ) {
    130                 $full_path .= ( $pathdir != '' ? '/' : '' ) . sanitize_title( $pathdir );
     130                $full_path .= ( '' != $pathdir ? '/' : '' ) . sanitize_title( $pathdir );
    131131        }
    132132        $categories = get_terms(
     
    145145                $path        = '/' . $leaf_path;
    146146                $curcategory = $category;
    147                 while ( ( $curcategory->parent != 0 ) && ( $curcategory->parent != $curcategory->term_id ) ) {
     147                while ( ( 0 != $curcategory->parent ) && ( $curcategory->parent != $curcategory->term_id ) ) {
    148148                        $curcategory = get_term( $curcategory->parent, 'category' );
    149149                        if ( is_wp_error( $curcategory ) ) {
Note: See TracChangeset for help on using the changeset viewer.