Changeset 6242

Show
Ignore:
Timestamp:
10/13/07 05:33:39 (1 year ago)
Author:
markjaquith
Message:

Some foreach array casting

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/post.php

    r6240 r6242  
    16671667 
    16681668    $ids = array(); 
    1669     foreach ( $post_ids as $id ) { 
     1669    foreach ( (array) $post_ids as $id ) { 
    16701670        if ( false === wp_cache_get($id, 'post_meta') ) 
    16711671            $ids[] = $id; 
     
    16791679    $cache = array(); 
    16801680    if ( $meta_list = $wpdb->get_results("SELECT post_id, meta_key, meta_value FROM $wpdb->postmeta WHERE post_id IN ($id_list) ORDER BY post_id, meta_key", ARRAY_A) ) { 
    1681         foreach ($meta_list as $metarow) { 
     1681        foreach ( (array) $meta_list as $metarow) { 
    16821682            $mpid = (int) $metarow['post_id']; 
    16831683            $mkey = $metarow['meta_key']; 
     
    16951695    } 
    16961696 
    1697     foreach ( $ids as $id ) { 
     1697    foreach ( (array) $ids as $id ) { 
    16981698        if ( ! isset($cache[$id]) ) 
    16991699            $cache[$id] = array();