Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a calendar/todo app on my wordpress site. I need to be able to let users set their timezone for this. The plan is to have a front end drop down, then jquery updates the user's object.

Does anybody know what the server side api to set an individual user's timezone? Something like:

wp_update_user(array(
    'id' => $id,
    'timezone' => '+1'
));

cheers, David

share|improve this question

closed as not a real question by toscho Jul 20 '12 at 23:40

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

1 Answer

There's no such thing as a user timezone per default. You can take a look at the current user data:

var_dump( $GLOBALS['current_user'] );

Btw: If you want to update user data, then change it and save the whole object. WP cares about the rest:

global $current_user;
// do stuff to the current user object
wp_update_user( $current_user );
// done!
share|improve this answer

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