Make WordPress Core


Ignore:
Timestamp:
05/23/2020 11:36:36 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison for count() calls.

See #49542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r47808 r47848  
    37103710
    37113711        // Make sure we set a valid category.
    3712         if ( empty( $post_category ) || 0 == count( $post_category ) || ! is_array( $post_category ) ) {
     3712        if ( empty( $post_category ) || 0 === count( $post_category ) || ! is_array( $post_category ) ) {
    37133713                // 'post' requires at least one category.
    37143714                if ( 'post' === $post_type && 'auto-draft' !== $post_status ) {
    … …  
    46854685                        $post_categories = array();
    46864686                }
    4687         } elseif ( 1 == count( $post_categories ) && '' === reset( $post_categories ) ) {
     4687        } elseif ( 1 === count( $post_categories ) && '' === reset( $post_categories ) ) {
    46884688                return true;
    46894689        }
    … …  
    54405440        }
    54415441
    5442         if ( 1 == count( $post_status ) ) {
     5442        if ( 1 === count( $post_status ) ) {
    54435443                $where_post_type = $wpdb->prepare( 'post_type = %s AND post_status = %s', $parsed_args['post_type'], reset( $post_status ) );
    54445444        } else {
Note: See TracChangeset for help on using the changeset viewer.