Make WordPress Core

Changeset 50699


Ignore:
Timestamp:
04/11/2021 01:42:25 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Simplify the check for parent terms in export_wp().

This is more consistent with similar checks elsewhere in core.

See #52627.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/export.php

    r50011 r50699  
    170170        // Put categories in order with no child going before its parent.
    171171        while ( $cat = array_shift( $categories ) ) {
    172             if ( 0 == $cat->parent || isset( $cats[ $cat->parent ] ) ) {
     172            if ( ! $cat->parent || isset( $cats[ $cat->parent ] ) ) {
    173173                $cats[ $cat->term_id ] = $cat;
    174174            } else {
     
    179179        // Put terms in order with no child going before its parent.
    180180        while ( $t = array_shift( $custom_terms ) ) {
    181             if ( 0 == $t->parent || isset( $terms[ $t->parent ] ) ) {
     181            if ( ! $t->parent || isset( $terms[ $t->parent ] ) ) {
    182182                $terms[ $t->term_id ] = $t;
    183183            } else {
Note: See TracChangeset for help on using the changeset viewer.