WordPress.org

Make WordPress Core


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

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

See #49542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/nav-menus.php

    r47808 r47848  
    424424$locations_screen = ( isset( $_GET['action'] ) && 'locations' === $_GET['action'] ) ? true : false;
    425425
     426$page_count = wp_count_posts( 'page' );
     427
    426428/*
    427429 * If we have one theme location, and zero menus, we take them right
    428430 * into editing their first menu.
    429431 */
    430 $page_count                  = wp_count_posts( 'page' );
    431 $one_theme_location_no_menus = ( 1 == count( get_registered_nav_menus() ) && ! $add_new_screen && empty( $nav_menus ) && ! empty( $page_count->publish ) ) ? true : false;
     432if ( 1 === count( get_registered_nav_menus() ) && ! $add_new_screen
     433    && empty( $nav_menus ) && ! empty( $page_count->publish )
     434) {
     435    $one_theme_location_no_menus = true;
     436} else {
     437    $one_theme_location_no_menus = false;
     438}
    432439
    433440$nav_menus_l10n = array(
     
    929936                                <?php
    930937                                $hide_style = '';
    931                                 if ( isset( $menu_items ) && 0 == count( $menu_items ) ) {
     938                                if ( isset( $menu_items ) && 0 === count( $menu_items ) ) {
    932939                                    $hide_style = 'style="display: none;"';
    933940                                }
Note: See TracChangeset for help on using the changeset viewer.