Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison where static strings are involved.

This reduces the number of WordPress.PHP.StrictComparisons.LooseComparison issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyten/loop.php

    r47122 r47808  
    6363    <?php /* How to display posts of the Gallery format. The gallery category is the old way. */ ?>
    6464
    65     <?php if ( ( function_exists( 'get_post_format' ) && 'gallery' == get_post_format( $post->ID ) ) || in_category( _x( 'gallery', 'gallery category slug', 'twentyten' ) ) ) : ?>
     65    <?php if ( ( function_exists( 'get_post_format' ) && 'gallery' === get_post_format( $post->ID ) ) || in_category( _x( 'gallery', 'gallery category slug', 'twentyten' ) ) ) : ?>
    6666        <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    6767            <h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
     
    103103            <?php
    104104            $gallery = get_term_by( 'slug', _x( 'gallery', 'gallery category slug', 'twentyten' ), 'category' );
    105             if ( function_exists( 'get_post_format' ) && 'gallery' == get_post_format( $post->ID ) ) :
     105            if ( function_exists( 'get_post_format' ) && 'gallery' === get_post_format( $post->ID ) ) :
    106106                ?>
    107107                <a href="<?php echo esc_url( get_post_format_link( 'gallery' ) ); ?>" title="<?php esc_attr_e( 'View Galleries', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a>
     
    118118        <?php /* How to display posts of the Aside format. The asides category is the old way. */ ?>
    119119
    120     <?php elseif ( ( function_exists( 'get_post_format' ) && 'aside' == get_post_format( $post->ID ) ) || in_category( _x( 'asides', 'asides category slug', 'twentyten' ) ) ) : ?>
     120    <?php elseif ( ( function_exists( 'get_post_format' ) && 'aside' === get_post_format( $post->ID ) ) || in_category( _x( 'asides', 'asides category slug', 'twentyten' ) ) ) : ?>
    121121        <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    122122
Note: See TracChangeset for help on using the changeset viewer.