summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-includes/functions.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-09-19 12:43:44 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-09-19 12:43:44 +0000
commit0b9d1b3be4a25d07c214c174916fcdc81e5ca15d (patch)
treef927250c89e0fd7b9088a12540cfe1e2b48c79d8 /wp-inst/wp-includes/functions.php
parent93053f4309be3c418840659e287852cd66f05748 (diff)
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@341 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/functions.php')
-rw-r--r--wp-inst/wp-includes/functions.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/wp-inst/wp-includes/functions.php b/wp-inst/wp-includes/functions.php
index bb24d22..b2362e0 100644
--- a/wp-inst/wp-includes/functions.php
+++ b/wp-inst/wp-includes/functions.php
@@ -2052,7 +2052,7 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) {
$meta_value = serialize($meta_value);
$cur = $wpdb->get_row("SELECT * FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'");
- if ( !$cur ) {
+ if ( !$cur && !empty( $meta_value ) ) {
$wpdb->query("INSERT INTO $wpdb->usermeta ( user_id, meta_key, meta_value )
VALUES
( '$user_id', '$meta_key', '$meta_value' )");
@@ -2060,6 +2060,8 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) {
}
if ( $cur->meta_value != $meta_value )
$wpdb->query("UPDATE $wpdb->usermeta SET meta_value = '$meta_value' WHERE user_id = '$user_id' AND meta_key = '$meta_key'");
+ if ( empty( $meta_value ) )
+ $wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'");
}
function register_activation_hook($file, $function) {