summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-includes/functions.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-11-22 09:42:38 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-11-22 09:42:38 +0000
commitfd1daa507e7a138d175a98d26fcd70c38c67c324 (patch)
treef3249c60e421dc91d5fd551e69c9f068a3d47eb9 /wp-inst/wp-includes/functions.php
parentff3bf19b3af49593d927b50d5c231526159821b3 (diff)
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@444 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/functions.php')
-rw-r--r--wp-inst/wp-includes/functions.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/wp-inst/wp-includes/functions.php b/wp-inst/wp-includes/functions.php
index 4fc8df2..aa2150f 100644
--- a/wp-inst/wp-includes/functions.php
+++ b/wp-inst/wp-includes/functions.php
@@ -514,15 +514,17 @@ function update_post_meta($post_id, $key, $value, $prev_value = '') {
$wpdb->query("UPDATE $wpdb->postmeta SET meta_value = '$value' WHERE
meta_key = '$key' AND post_id = '$post_id'");
$cache_key = $post_meta_cache['$post_id'][$key];
- foreach ($cache_key as $index => $data)
- $post_meta_cache['$post_id'][$key][$index] = $original_value;
+ if ( !empty($cache_key) )
+ foreach ($cache_key as $index => $data)
+ $post_meta_cache['$post_id'][$key][$index] = $original_value;
} else {
$wpdb->query("UPDATE $wpdb->postmeta SET meta_value = '$value' WHERE
meta_key = '$key' AND post_id = '$post_id' AND meta_value = '$prev_value'");
$cache_key = $post_meta_cache['$post_id'][$key];
- foreach ($cache_key as $index => $data)
- if ( $data == $original_prev )
- $post_meta_cache['$post_id'][$key][$index] = $original_value;
+ if ( !empty($cache_key) )
+ foreach ($cache_key as $index => $data)
+ if ( $data == $original_prev )
+ $post_meta_cache['$post_id'][$key][$index] = $original_value;
}
return true;