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

    r47219 r47808  
    3838
    3939    // Back compat.
    40     if ( isset( $args['type'] ) && 'link' == $args['type'] ) {
     40    if ( isset( $args['type'] ) && 'link' === $args['type'] ) {
    4141        _deprecated_argument(
    4242            __FUNCTION__,
     
    127127    $category_paths = explode( '/', $category_paths );
    128128    $full_path      = '';
     129
    129130    foreach ( (array) $category_paths as $pathdir ) {
    130         $full_path .= ( '' != $pathdir ? '/' : '' ) . sanitize_title( $pathdir );
    131     }
     131        $full_path .= ( '' !== $pathdir ? '/' : '' ) . sanitize_title( $pathdir );
     132    }
     133
    132134    $categories = get_terms(
    133135        array(
Note: See TracChangeset for help on using the changeset viewer.