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

    r47557 r47808  
    119119                }
    120120                // Submit box cannot be hidden.
    121                 if ( 'submitdiv' == $box['id'] || 'linksubmitdiv' == $box['id'] ) {
     121                if ( 'submitdiv' === $box['id'] || 'linksubmitdiv' === $box['id'] ) {
    122122                    continue;
    123123                }
     
    162162    if ( $use_defaults ) {
    163163        $hidden = array();
    164         if ( 'post' == $screen->base ) {
    165             if ( 'post' == $screen->post_type || 'page' == $screen->post_type || 'attachment' == $screen->post_type ) {
     164        if ( 'post' === $screen->base ) {
     165            if ( in_array( $screen->post_type, array( 'post', 'page', 'attachment' ), true ) ) {
    166166                $hidden = array( 'slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv' );
    167167            } else {
Note: See TracChangeset for help on using the changeset viewer.