wp_update_user is deleting user_meta ?
-
I’ve tested over and over to make sure this is what’s happening…. I need to verify with someone familiar with this…
I have a user signing up. Defaults to “subscriber”. When they pay for a paypal membership, the notify URL is working great. They become a member AND I’m changing their role from “subscriber” to “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 user’s meta into a variable, then do the role update, then “re” update the user’s meta?? Seems a bit much but I’m stumped.
- The topic ‘wp_update_user is deleting user_meta ?’ is closed to new replies.