WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/09/2020 04:52:28 PM (14 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/class-wp-posts-list-table.php

    r47122 r47219  
    166166            } elseif ( isset( $_REQUEST['show_sticky'] ) && $_REQUEST['show_sticky'] ) {
    167167                $total_items = $this->sticky_posts_count;
    168             } elseif ( isset( $_GET['author'] ) && $_GET['author'] == get_current_user_id() ) {
     168            } elseif ( isset( $_GET['author'] ) && get_current_user_id() == $_GET['author'] ) {
    169169                $total_items = $this->user_posts_count;
    170170            } else {
     
    179179
    180180        if ( ! empty( $_REQUEST['mode'] ) ) {
    181             $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
     181            $mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list';
    182182            set_user_setting( 'posts_list_mode', $mode );
    183183        } else {
     
    185185        }
    186186
    187         $this->is_trash = isset( $_REQUEST['post_status'] ) && $_REQUEST['post_status'] === 'trash';
     187        $this->is_trash = isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'];
    188188
    189189        $this->set_pagination_args(
     
    994994        $can_edit_post = current_user_can( 'edit_post', $post->ID );
    995995
    996         if ( $can_edit_post && $post->post_status != 'trash' ) {
     996        if ( $can_edit_post && 'trash' !== $post->post_status ) {
    997997            $lock_holder = wp_check_post_lock( $post->ID );
    998998
     
    10151015        $title = _draft_or_post_title();
    10161016
    1017         if ( $can_edit_post && $post->post_status != 'trash' ) {
     1017        if ( $can_edit_post && 'trash' !== $post->post_status ) {
    10181018            printf(
    10191019                '<a class="row-title" href="%s" aria-label="%s">%s%s</a>',
     
    16341634
    16351635                        <span class="title inline-edit-categories-label"><?php echo esc_html( $taxonomy->labels->name ); ?></span>
    1636                         <input type="hidden" name="<?php echo ( $taxonomy->name === 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" />
     1636                        <input type="hidden" name="<?php echo ( 'category' === $taxonomy->name ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" />
    16371637                        <ul class="cat-checklist <?php echo esc_attr( $taxonomy->name ); ?>-checklist">
    16381638                            <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ); ?>
Note: See TracChangeset for help on using the changeset viewer.