From 836286e8ec52080af5d79afd0f9b60e5e5bfa1d0 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 11 Oct 2006 09:18:54 +0000 Subject: [PATCH] Post meta caching fix by mdawaffe. fixes #3229 git-svn-id: https://develop.svn.wordpress.org/trunk@4372 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 2 +- wp-includes/post-template.php | 2 +- wp-includes/post.php | 54 ++++++++++++++++++----------------- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index f6d58f8f92..1d348571c2 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -542,7 +542,7 @@ function update_post_caches(&$posts) { // Change from flat structure to hierarchical: $post_meta_cache = array(); foreach ($meta_list as $metarow) { - $mpid = $metarow['post_id']; + $mpid = (int) $metarow['post_id']; $mkey = $metarow['meta_key']; $mval = $metarow['meta_value']; diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 7f849167bf..db804e1b5a 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -211,7 +211,7 @@ function post_custom( $key = '' ) { // this will probably change at some point... function the_meta() { - global $id, $post_meta_cache; + global $id; if ( $keys = get_post_custom_keys() ) { echo "