Make WordPress Core


Ignore:
Timestamp:
08/25/2015 08:27:56 PM (9 years ago)
Author:
wonderboymusic
Message:

foreach is a statement, not a function.

See #33491.

File:
1 edited

Legend:

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

    r33211 r33734  
    427427            if ( empty( $terms ) || is_wp_error( $terms ) )
    428428                return;
    429             foreach( (array) $terms as $term ) {
     429            foreach ( (array) $terms as $term ) {
    430430                if ( 'markup' == $response_format ) {
    431431                    echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( $term ) ), 0, (object) $args );
     
    10821082
    10831083        // Loop through all the menu items' POST values.
    1084         foreach( (array) $menu_data as $_possible_db_id => $_item_object_data ) {
     1084        foreach ( (array) $menu_data as $_possible_db_id => $_item_object_data ) {
    10851085            if (
    10861086                // Checkbox is not checked.
     
    12151215
    12161216        $some_pending_menu_items = $some_invalid_menu_items = false;
    1217         foreach( (array) $menu_items as $menu_item ) {
     1217        foreach ( (array) $menu_items as $menu_item ) {
    12181218            if ( isset( $menu_item->post_status ) && 'draft' == $menu_item->post_status )
    12191219                $some_pending_menu_items = true;
     
    12721272    $menu_items_to_delete = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts AS p LEFT JOIN $wpdb->postmeta AS m ON p.ID = m.post_id WHERE post_type = 'nav_menu_item' AND post_status = 'draft' AND meta_key = '_menu_item_orphaned' AND meta_value < '%d'", $delete_timestamp ) );
    12731273
    1274     foreach( (array) $menu_items_to_delete as $menu_item_id )
     1274    foreach ( (array) $menu_items_to_delete as $menu_item_id )
    12751275        wp_delete_post( $menu_item_id, true );
    12761276}
     
    13031303    // Loop through all the menu items' POST variables
    13041304    if ( ! empty( $_POST['menu-item-db-id'] ) ) {
    1305         foreach( (array) $_POST['menu-item-db-id'] as $_key => $k ) {
     1305        foreach ( (array) $_POST['menu-item-db-id'] as $_key => $k ) {
    13061306
    13071307            // Menu item title can't be blank
Note: See TracChangeset for help on using the changeset viewer.