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-admin/includes/class-walker-nav-menu-edit.php

    r47190 r47808  
    7373        $original_title = false;
    7474
    75         if ( 'taxonomy' == $item->type ) {
     75        if ( 'taxonomy' === $item->type ) {
    7676            $original_object = get_term( (int) $item->object_id, $item->object );
    7777            if ( $original_object && ! is_wp_error( $original_title ) ) {
    7878                $original_title = $original_object->name;
    7979            }
    80         } elseif ( 'post_type' == $item->type ) {
     80        } elseif ( 'post_type' === $item->type ) {
    8181            $original_object = get_post( $item->object_id );
    8282            if ( $original_object ) {
    8383                $original_title = get_the_title( $original_object->ID );
    8484            }
    85         } elseif ( 'post_type_archive' == $item->type ) {
     85        } elseif ( 'post_type_archive' === $item->type ) {
    8686            $original_object = get_post_type_object( $item->object );
    8787            if ( $original_object ) {
     
    102102            /* translators: %s: Title of an invalid menu item. */
    103103            $title = sprintf( __( '%s (Invalid)' ), $item->title );
    104         } elseif ( isset( $item->post_status ) && 'draft' == $item->post_status ) {
     104        } elseif ( isset( $item->post_status ) && 'draft' === $item->post_status ) {
    105105            $classes[] = 'pending';
    106106            /* translators: %s: Title of a menu item in draft status. */
     
    108108        }
    109109
    110         $title = ( ! isset( $item->label ) || '' == $item->label ) ? $title : $item->label;
     110        $title = ( ! isset( $item->label ) || '' === $item->label ) ? $title : $item->label;
    111111
    112112        $submenu_text = '';
     
    182182
    183183            <div class="menu-item-settings wp-clearfix" id="menu-item-settings-<?php echo $item_id; ?>">
    184                 <?php if ( 'custom' == $item->type ) : ?>
     184                <?php if ( 'custom' === $item->type ) : ?>
    185185                    <p class="field-url description description-wide">
    186186                        <label for="edit-menu-item-url-<?php echo $item_id; ?>">
Note: See TracChangeset for help on using the changeset viewer.