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/class-wp-customize-nav-menus.php

    r47764 r47808  
    155155            if ( 0 === $page && 'page' === $object ) {
    156156                // Insert Front Page or custom "Home" link.
    157                 $front_page = 'page' == get_option( 'show_on_front' ) ? (int) get_option( 'page_on_front' ) : 0;
     157                $front_page = 'page' === get_option( 'show_on_front' ) ? (int) get_option( 'page_on_front' ) : 0;
    158158                if ( ! empty( $front_page ) ) {
    159159                    $front_page_obj      = get_post( $front_page );
     
    173173
    174174                // Insert Posts Page.
    175                 $posts_page = 'page' == get_option( 'show_on_front' ) ? (int) get_option( 'page_for_posts' ) : 0;
     175                $posts_page = 'page' === get_option( 'show_on_front' ) ? (int) get_option( 'page_for_posts' ) : 0;
    176176                if ( ! empty( $posts_page ) ) {
    177177                    $posts_page_obj      = get_post( $posts_page );
     
    446446        if ( isset( $args['s'] ) ) {
    447447            // Only insert custom "Home" link if there's no Front Page
    448             $front_page = 'page' == get_option( 'show_on_front' ) ? (int) get_option( 'page_on_front' ) : 0;
     448            $front_page = 'page' === get_option( 'show_on_front' ) ? (int) get_option( 'page_on_front' ) : 0;
    449449            if ( empty( $front_page ) ) {
    450450                $title   = _x( 'Home', 'nav menu home label' );
Note: See TracChangeset for help on using the changeset viewer.