[wp-hackers] User Details don't update until second refresh of page?

Dion Hulse (dd32) wordpress at dd32.id.au
Tue Jun 14 14:04:17 UTC 2011

The cache will be being filled with the userdata before your update (or
perhaps, as part of the update).
You'll need to either clean, or update the cache (If you have an object of
the correct user data, update, else, clean)
See clean_user_cache($user_id); and update_user_caches(&$user);


On 14 June 2011 23:58, Robert Lusby <nanogwp at gmail.com> wrote:

> I'm updating user details by way of wp_update_user, a form submitted on
> POST and a hook on "init".
> User submits the form with new details, and they all get updated in the
> database via the hook above and WP function.
> However further down the page when this updated user values are called (via
> get_currentuserinfo()) ... it will load with the OLD user data, until
> refreshing the page for a second time.
> I thought anything in the theme ran "after" init?
> Obviously I'm missing something as the database changes happen, and the
> user details get updated, but "echo $current_user->user_firstname" will
> still output the previous firstname until doing a second refresh.
> Any ideas?
> Thanks!
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list