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

    r47372 r47808  
    123123    }
    124124
    125     if ( 'auto-draft' == $post->post_status ) {
     125    if ( 'auto-draft' === $post->post_status ) {
    126126        return;
    127127    }
     
    309309    }
    310310
    311     if ( isset( $post['post_type'] ) && 'revision' == $post['post_type'] ) {
     311    if ( isset( $post['post_type'] ) && 'revision' === $post['post_type'] ) {
    312312        return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );
    313313    }
     
    617617    }
    618618
    619     if ( empty( $_REQUEST['post_format'] ) || $post->ID != $post_id || 'post_format' != $taxonomy || 'revision' == $post->post_type ) {
     619    if ( empty( $_REQUEST['post_format'] ) || $post->ID != $post_id
     620        || 'post_format' !== $taxonomy || 'revision' === $post->post_type
     621    ) {
    620622        return $terms;
    621623    }
    622624
    623     if ( 'standard' == $_REQUEST['post_format'] ) {
     625    if ( 'standard' === $_REQUEST['post_format'] ) {
    624626        $terms = array();
    625627    } else {
     
    653655        empty( $_REQUEST['preview_id'] ) ||
    654656        $post->ID != $post_id ||
    655         '_thumbnail_id' != $meta_key ||
    656         'revision' == $post->post_type ||
     657        '_thumbnail_id' !== $meta_key ||
     658        'revision' === $post->post_type ||
    657659        $post_id != $_REQUEST['preview_id'] ) {
    658660
Note: See TracChangeset for help on using the changeset viewer.