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/twentyfifteen/functions.php

    r47122 r47808  
    321321        $subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'twentyfifteen' );
    322322
    323         if ( 'cyrillic' == $subset ) {
     323        if ( 'cyrillic' === $subset ) {
    324324            $subsets .= ',cyrillic,cyrillic-ext';
    325         } elseif ( 'greek' == $subset ) {
     325        } elseif ( 'greek' === $subset ) {
    326326            $subsets .= ',greek,greek-ext';
    327         } elseif ( 'devanagari' == $subset ) {
     327        } elseif ( 'devanagari' === $subset ) {
    328328            $subsets .= ',devanagari';
    329         } elseif ( 'vietnamese' == $subset ) {
     329        } elseif ( 'vietnamese' === $subset ) {
    330330            $subsets .= ',vietnamese';
    331331        }
     
    461461    $css      = '';
    462462
    463     if ( is_attachment() && 'attachment' == $previous->post_type ) {
     463    if ( is_attachment() && 'attachment' === $previous->post_type ) {
    464464        return;
    465465    }
     
    499499 */
    500500function twentyfifteen_nav_description( $item_output, $item, $depth, $args ) {
    501     if ( 'primary' == $args->theme_location && $item->description ) {
     501    if ( 'primary' === $args->theme_location && $item->description ) {
    502502        $item_output = str_replace( $args->link_after . '</a>', '<div class="menu-item-description">' . $item->description . '</div>' . $args->link_after . '</a>', $item_output );
    503503    }
Note: See TracChangeset for help on using the changeset viewer.