Does wp_update_user delete user_meta?
-
I’ve tested over and over to make sure this is what’s happening…. I need to verify with someone familiar with wp_update_user…
I have a user signing up. The new role defaults to “subscriber”. When they pay for a paypal membership, the notify URL is working great. Their role is updated to a “member”.
When paypal notifies my site I’m using this for the update…
wp_update_user( array (‘ID’ => $user_id, ‘role’ => $new_role) ) ;
NOW, this IS working EXCEPT, it’s wiping out this user’s meta info. AND… It’s not wiping out all of it, just most of it… what the heck??
When I comment out this wp_update_user code, the PP notify still does it’s job and the user’s meta is still in tact.
What is the best way to handle this? My thought is get the all of the user’s meta into an array, then do the role update, then upack the array and “re” update the user’s meta?? Seems a bit much but I’m stumped.
The topic ‘Does wp_update_user delete user_meta?’ is closed to new replies.