From 23666ca10494111e25a12ca1c87f726b45e63404 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Sat, 13 Oct 2007 05:33:39 +0000 Subject: [PATCH] Some foreach array casting git-svn-id: https://develop.svn.wordpress.org/trunk@6242 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 05899f7f40..2ced5f0572 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1666,7 +1666,7 @@ function update_postmeta_cache($post_ids) { return false; $ids = array(); - foreach ( $post_ids as $id ) { + foreach ( (array) $post_ids as $id ) { if ( false === wp_cache_get($id, 'post_meta') ) $ids[] = $id; } @@ -1678,7 +1678,7 @@ function update_postmeta_cache($post_ids) { $id_list = join(',', $ids); $cache = array(); 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) ) { - foreach ($meta_list as $metarow) { + foreach ( (array) $meta_list as $metarow) { $mpid = (int) $metarow['post_id']; $mkey = $metarow['meta_key']; $mval = $metarow['meta_value']; @@ -1694,7 +1694,7 @@ function update_postmeta_cache($post_ids) { } } - foreach ( $ids as $id ) { + foreach ( (array) $ids as $id ) { if ( ! isset($cache[$id]) ) $cache[$id] = array(); }