Ticket #57318: 57318.patch
File 57318.patch, 1.7 KB (added by , 22 months ago) |
---|
-
nav-menu.php
926 926 $menu_id = (int) $menu_id; 927 927 $items_saved = array(); 928 928 929 if ( 0 == $menu_id || is_nav_menu( $menu_id ) ) {929 if ( 0 === $menu_id || is_nav_menu( $menu_id ) ) { 930 930 931 931 // Loop through all the menu items' POST values. 932 932 foreach ( (array) $menu_data as $_possible_db_id => $_item_object_data ) { … … 952 952 if ( 953 953 empty( $_item_object_data['menu-item-db-id'] ) || 954 954 ( 0 > $_possible_db_id ) || 955 $_possible_db_id != $_item_object_data['menu-item-db-id']955 $_possible_db_id !== $_item_object_data['menu-item-db-id'] 956 956 ) { 957 957 $_actual_db_id = 0; 958 958 } else { … … 1199 1199 $args[ $field ] = isset( $_POST[ $field ][ $_key ] ) ? $_POST[ $field ][ $_key ] : ''; 1200 1200 } 1201 1201 1202 $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][ $_key ] != $_key ? 0 : $_key ), $args );1202 $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][ $_key ] !== $_key ? 0 : $_key ), $args ); 1203 1203 1204 1204 if ( is_wp_error( $menu_item_db_id ) ) { 1205 1205 $messages[] = '<div id="message" class="error"><p>' . $menu_item_db_id->get_error_message() . '</p></div>'; … … 1289 1289 1290 1290 // Build the new array value from leaf to trunk. 1291 1291 for ( $i = count( $array_bits ) - 1; $i >= 0; $i-- ) { 1292 if ( count( $array_bits ) - 1 == $i ) {1292 if ( count( $array_bits ) - 1 === $i ) { 1293 1293 $new_post_data[ $array_bits[ $i ] ] = wp_slash( $post_input_data->value ); 1294 1294 } else { 1295 1295 $new_post_data = array( $array_bits[ $i ] => $new_post_data );