Make WordPress Core


Ignore:
Timestamp:
03/26/2023 10:04:40 AM (11 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-admin/includes/nav-menu.php.

Follow-up to [14248], [15008], [37748].

Props jenilk, johnbillion.
Fixes #57318.

File:
1 edited

Legend:

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

    r55293 r55593  
    939939    $items_saved = array();
    940940
    941     if ( 0 == $menu_id || is_nav_menu( $menu_id ) ) {
     941    if ( 0 === $menu_id || is_nav_menu( $menu_id ) ) {
    942942
    943943        // Loop through all the menu items' POST values.
     
    965965                empty( $_item_object_data['menu-item-db-id'] ) ||
    966966                ( 0 > $_possible_db_id ) ||
    967                 $_possible_db_id != $_item_object_data['menu-item-db-id']
     967                $_possible_db_id !== (int) $_item_object_data['menu-item-db-id']
    968968            ) {
    969969                $_actual_db_id = 0;
     
    12121212            }
    12131213
    1214             $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][ $_key ] != $_key ? 0 : $_key ), $args );
     1214            $menu_item_db_id = wp_update_nav_menu_item(
     1215                $nav_menu_selected_id,
     1216                ( (int) $_POST['menu-item-db-id'][ $_key ] !== $_key ? 0 : $_key ),
     1217                $arg
     1218            );
    12151219
    12161220            if ( is_wp_error( $menu_item_db_id ) ) {
     
    13021306            // Build the new array value from leaf to trunk.
    13031307            for ( $i = count( $array_bits ) - 1; $i >= 0; $i-- ) {
    1304                 if ( count( $array_bits ) - 1 == $i ) {
     1308                if ( count( $array_bits ) - 1 === $i ) {
    13051309                    $new_post_data[ $array_bits[ $i ] ] = wp_slash( $post_input_data->value );
    13061310                } else {
Note: See TracChangeset for help on using the changeset viewer.