Ticket #11254: deprecated.diff
File deprecated.diff, 1.4 KB (added by , 15 years ago) |
---|
-
deprecated.php
2277 2277 */ 2278 2278 function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) { 2279 2279 _deprecated_function( __FUNCTION__, '3.0', 'delete_user_meta()' ); 2280 global $wpdb ;2280 global $wpdb,$current_user; 2281 2281 if ( !is_numeric( $user_id ) ) 2282 2282 return false; 2283 2283 $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key); … … 2300 2300 2301 2301 if ( $cur && $cur->umeta_id ) 2302 2302 do_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); 2303 2304 // update global $current_user to remove the removed meta_value 2305 $current_user = new WP_User($user_id); 2306 setup_userdata($user_id); 2303 2307 2304 2308 return true; 2305 2309 } … … 2377 2381 */ 2378 2382 function update_usermeta( $user_id, $meta_key, $meta_value ) { 2379 2383 _deprecated_function( __FUNCTION__, '3.0', 'update_user_meta()' ); 2380 global $wpdb ;2384 global $wpdb,$current_user; 2381 2385 if ( !is_numeric( $user_id ) ) 2382 2386 return false; 2383 2387 $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key); … … 2409 2413 do_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value ); 2410 2414 else 2411 2415 do_action( 'updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); 2416 2417 // update the variable with new data 2418 $current_user = new WP_User($user_id); 2419 setup_userdata($user_id); 2412 2420 2413 2421 return true; 2414 2422 }