Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (5 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/options-discussion.php

    r47583 r47808  
    126126<?php
    127127$default_comments_page = '</label> <label for="default_comments_page"><select name="default_comments_page" id="default_comments_page"><option value="newest"';
    128 if ( 'newest' == get_option( 'default_comments_page' ) ) {
     128if ( 'newest' === get_option( 'default_comments_page' ) ) {
    129129    $default_comments_page .= ' selected="selected"';
    130130}
    131131$default_comments_page .= '>' . __( 'last' ) . '</option><option value="oldest"';
    132 if ( 'oldest' == get_option( 'default_comments_page' ) ) {
     132if ( 'oldest' === get_option( 'default_comments_page' ) ) {
    133133    $default_comments_page .= ' selected="selected"';
    134134}
     
    147147
    148148$comment_order = '<select name="comment_order" id="comment_order"><option value="asc"';
    149 if ( 'asc' == get_option( 'comment_order' ) ) {
     149if ( 'asc' === get_option( 'comment_order' ) ) {
    150150    $comment_order .= ' selected="selected"';
    151151}
    152152$comment_order .= '>' . __( 'older' ) . '</option><option value="desc"';
    153 if ( 'desc' == get_option( 'comment_order' ) ) {
     153if ( 'desc' === get_option( 'comment_order' ) ) {
    154154    $comment_order .= ' selected="selected"';
    155155}
Note: See TracChangeset for help on using the changeset viewer.