From 6e8d3ba537daa4977582d69054a3264009895795 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Wed, 11 Oct 2006 09:18:54 +0000 Subject: [PATCH] Post meta caching fix by mdawaffe. fixes #3229 git-svn-id: http://svn.automattic.com/wordpress/trunk@4372 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 f6d58f8f9..1d348571c 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 7f849167b..db804e1b5 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 "