Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 :

$user=get_user_by('login',"user3465");
wp_set_password(''.$new_password.'',$user->ID);
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 ?

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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