I am using the API code of WordPress to update some fields of user profiles but I am having some problems.

When I try to save information, it is not updating unless I click twice. For example for user called user3465

For example :

update_user_meta($user->ID, 'user_email', "".$new_email."" );

I launch form and load new data in database, but I must launch another time, to see the data change.

Why is this ?


It sounds like you are updating the user information after the form has been displayed. You need to rearrange your code so that you are updating the user information earlier, before the form is displayed.

If you need help figuring out how to do that, then you need to share some more details about how you are doing it now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.