WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (11 months 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/twentyeleven/content-single.php

    r47122 r47808  
    1313        <h1 class="entry-title"><?php the_title(); ?></h1>
    1414
    15         <?php if ( 'post' == get_post_type() ) : ?>
     15        <?php if ( 'post' === get_post_type() ) : ?>
    1616        <div class="entry-meta">
    1717            <?php twentyeleven_posted_on(); ?>
     
    3434    <footer class="entry-meta">
    3535        <?php
    36             /* translators: Used between list items, there is a space after the comma. */
    37             $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     36        /* translators: Used between list items, there is a space after the comma. */
     37        $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
    3838
    39             /* translators: Used between list items, there is a space after the comma. */
    40             $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    41         if ( '' != $tag_list ) {
     39        /* translators: Used between list items, there is a space after the comma. */
     40        $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     41
     42        if ( '' !== $tag_list ) {
    4243            /* translators: 1: Categories list, 2: Tag list, 3: Permalink, 4: Post title, 5: Author name, 6: Author URL. */
    4344            $utility_text = __( 'This entry was posted in %1$s and tagged %2$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
    44         } elseif ( '' != $categories_list ) {
     45        } elseif ( '' !== $categories_list ) {
    4546            /* translators: 1: Categories list, 2: Tag list, 3: Permalink, 4: Post title, 5: Author name, 6: Author URL. */
    4647            $utility_text = __( 'This entry was posted in %1$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
     
    5051        }
    5152
    52             printf(
    53                 $utility_text,
    54                 $categories_list,
    55                 $tag_list,
    56                 esc_url( get_permalink() ),
    57                 the_title_attribute( 'echo=0' ),
    58                 get_the_author(),
    59                 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) )
    60             );
    61             ?>
     53        printf(
     54            $utility_text,
     55            $categories_list,
     56            $tag_list,
     57            esc_url( get_permalink() ),
     58            the_title_attribute( 'echo=0' ),
     59            get_the_author(),
     60            esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) )
     61        );
     62        ?>
     63
    6264        <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
    6365
Note: See TracChangeset for help on using the changeset viewer.