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-includes/option.php

    r47611 r47808  
    129129
    130130    // If home is not set, use siteurl.
    131     if ( 'home' == $option && '' == $value ) {
     131    if ( 'home' === $option && '' === $value ) {
    132132        return get_option( 'siteurl' );
    133133    }
     
    509509
    510510    if ( ! wp_installing() ) {
    511         if ( 'yes' == $autoload ) {
     511        if ( 'yes' === $autoload ) {
    512512            $alloptions            = wp_load_alloptions( true );
    513513            $alloptions[ $option ] = $serialized_value;
     
    587587    $result = $wpdb->delete( $wpdb->options, array( 'option_name' => $option ) );
    588588    if ( ! wp_installing() ) {
    589         if ( 'yes' == $row->autoload ) {
     589        if ( 'yes' === $row->autoload ) {
    590590            $alloptions = wp_load_alloptions( true );
    591591            if ( is_array( $alloptions ) && isset( $alloptions[ $option ] ) ) {
     
    21552155    }
    21562156
    2157     if ( 'misc' == $option_group ) {
     2157    if ( 'misc' === $option_group ) {
    21582158        _deprecated_argument(
    21592159            __FUNCTION__,
     
    21682168    }
    21692169
    2170     if ( 'privacy' == $option_group ) {
     2170    if ( 'privacy' === $option_group ) {
    21712171        _deprecated_argument(
    21722172            __FUNCTION__,
     
    22082208    global $new_whitelist_options, $wp_registered_settings;
    22092209
    2210     if ( 'misc' == $option_group ) {
     2210    if ( 'misc' === $option_group ) {
    22112211        _deprecated_argument(
    22122212            __FUNCTION__,
     
    22212221    }
    22222222
    2223     if ( 'privacy' == $option_group ) {
     2223    if ( 'privacy' === $option_group ) {
    22242224        _deprecated_argument(
    22252225            __FUNCTION__,
Note: See TracChangeset for help on using the changeset viewer.