From 4a43a0b35334bf74078530f9803275474573ffea Mon Sep 17 00:00:00 2001 From: markjaquith Date: Sat, 13 Oct 2007 05:33:39 +0000 Subject: [PATCH] Some foreach array casting git-svn-id: http://svn.automattic.com/wordpress/trunk@6242 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 05899f7f4..2ced5f057 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(); }