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/bookmark.php

    r47550 r47808  
    419419    }
    420420
    421     if ( 'raw' == $context ) {
     421    if ( 'raw' === $context ) {
    422422        return $value;
    423423    }
    424424
    425     if ( 'edit' == $context ) {
     425    if ( 'edit' === $context ) {
    426426        /** This filter is documented in wp-includes/post.php */
    427427        $value = apply_filters( "edit_{$field}", $value, $bookmark_id );
    428428
    429         if ( 'link_notes' == $field ) {
     429        if ( 'link_notes' === $field ) {
    430430            $value = esc_html( $value ); // textarea_escaped
    431431        } else {
    432432            $value = esc_attr( $value );
    433433        }
    434     } elseif ( 'db' == $context ) {
     434    } elseif ( 'db' === $context ) {
    435435        /** This filter is documented in wp-includes/post.php */
    436436        $value = apply_filters( "pre_{$field}", $value );
     
    439439        $value = apply_filters( "{$field}", $value, $bookmark_id, $context );
    440440
    441         if ( 'attribute' == $context ) {
     441        if ( 'attribute' === $context ) {
    442442            $value = esc_attr( $value );
    443         } elseif ( 'js' == $context ) {
     443        } elseif ( 'js' === $context ) {
    444444            $value = esc_js( $value );
    445445        }
Note: See TracChangeset for help on using the changeset viewer.