WordPress.org

Make WordPress Core


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

Coding Standards: Use Yoda conditions where appropriate.

See #49222.

File:
1 edited

Legend:

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

    r45742 r47219  
    169169        // Put categories in order with no child going before its parent.
    170170        while ( $cat = array_shift( $categories ) ) {
    171             if ( $cat->parent == 0 || isset( $cats[ $cat->parent ] ) ) {
     171            if ( 0 == $cat->parent || isset( $cats[ $cat->parent ] ) ) {
    172172                $cats[ $cat->term_id ] = $cat;
    173173            } else {
     
    178178        // Put terms in order with no child going before its parent.
    179179        while ( $t = array_shift( $custom_terms ) ) {
    180             if ( $t->parent == 0 || isset( $terms[ $t->parent ] ) ) {
     180            if ( 0 == $t->parent || isset( $terms[ $t->parent ] ) ) {
    181181                $terms[ $t->term_id ] = $t;
    182182            } else {
     
    586586        <wp:post_password><?php echo wxr_cdata( $post->post_password ); ?></wp:post_password>
    587587        <wp:is_sticky><?php echo intval( $is_sticky ); ?></wp:is_sticky>
    588                 <?php   if ( $post->post_type == 'attachment' ) : ?>
     588                <?php   if ( 'attachment' === $post->post_type ) : ?>
    589589        <wp:attachment_url><?php echo wxr_cdata( wp_get_attachment_url( $post->ID ) ); ?></wp:attachment_url>
    590590    <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.