Changeset 11909 for trunk/wp-includes/user.php
- Timestamp:
- 09/10/2009 02:43:45 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/user.php
r11397 r11909 308 308 $meta_value = trim( $meta_value ); 309 309 310 $cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); 311 312 if ( $cur && $cur->umeta_id ) 313 do_action( 'delete_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); 314 310 315 if ( ! empty($meta_value) ) 311 316 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $user_id, $meta_key, $meta_value) ); … … 314 319 315 320 wp_cache_delete($user_id, 'users'); 321 322 if ( $cur && $cur->umeta_id ) 323 do_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); 316 324 317 325 return true; … … 400 408 401 409 $cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); 410 411 if ( $cur ) 412 do_action( 'update_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); 413 402 414 if ( !$cur ) 403 415 $wpdb->insert($wpdb->usermeta, compact('user_id', 'meta_key', 'meta_value') ); … … 408 420 409 421 wp_cache_delete($user_id, 'users'); 422 423 if ( !$cur ) 424 do_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value ); 425 else 426 do_action( 'updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); 410 427 411 428 return true;
Note: See TracChangeset
for help on using the changeset viewer.