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-admin/includes/template.php

    r47198 r47219  
    433433
    434434    if ( ! $wp_list_table ) {
    435         if ( $mode == 'single' ) {
     435        if ( 'single' === $mode ) {
    436436            $wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table' );
    437437        } else {
     
    21962196
    21972197            // Display "Header Image" if the image was ever used as a header image.
    2198             if ( ! empty( $meta_header ) && $meta_header == $stylesheet && $header_image !== wp_get_attachment_url( $post->ID ) ) {
     2198            if ( ! empty( $meta_header ) && $meta_header === $stylesheet && wp_get_attachment_url( $post->ID ) !== $header_image ) {
    21992199                $media_states[] = __( 'Header Image' );
    22002200            }
    22012201
    22022202            // Display "Current Header Image" if the image is currently the header image.
    2203             if ( $header_image && $header_image == wp_get_attachment_url( $post->ID ) ) {
     2203            if ( $header_image && wp_get_attachment_url( $post->ID ) === $header_image ) {
    22042204                $media_states[] = __( 'Current Header Image' );
    22052205            }
     
    22102210        $meta_background = get_post_meta( $post->ID, '_wp_attachment_is_custom_background', true );
    22112211
    2212         if ( ! empty( $meta_background ) && $meta_background == $stylesheet ) {
     2212        if ( ! empty( $meta_background ) && $meta_background === $stylesheet ) {
    22132213            $media_states[] = __( 'Background Image' );
    22142214
    22152215            $background_image = get_background_image();
    2216             if ( $background_image && $background_image == wp_get_attachment_url( $post->ID ) ) {
     2216            if ( $background_image && wp_get_attachment_url( $post->ID ) === $background_image ) {
    22172217                $media_states[] = __( 'Current Background Image' );
    22182218            }
     
    22202220    }
    22212221
    2222     if ( $post->ID == get_option( 'site_icon' ) ) {
     2222    if ( get_option( 'site_icon' ) == $post->ID ) {
    22232223        $media_states[] = __( 'Site Icon' );
    22242224    }
    22252225
    2226     if ( $post->ID == get_theme_mod( 'custom_logo' ) ) {
     2226    if ( get_theme_mod( 'custom_logo' ) == $post->ID ) {
    22272227        $media_states[] = __( 'Logo' );
    22282228    }
Note: See TracChangeset for help on using the changeset viewer.