WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created a web application in which I have 3 columns, or i would say left sidebar, right sidebar and a middle widget area, I have few widgets in the left sidebar, few in the right sidebar and few in the middle widget area to give it a look of igoogle. Each user will have his widgets and then will also be able to drag and drop those widgets.I have added the drag and drop functionality of the widgets. What I want now is to save the dropped widgets position in the database and retrieve it for the user when he/she logs in again. Any sugestions as to how this can be done?

share|improve this question
This doesn't have anything to do with WordPress specifically ... I recommend asking on StackOverflow. – EAMann Oct 20 '10 at 20:18
nopes i need it in wordpress particularly, i have one for simple web and database saving sample also, but that is not helpful anyways for a web application in wordpress – MsManiya Oct 20 '10 at 20:25
Please explain in more detail how this applies to WordPress. As it is, I agree that it should be closed. – tnorthcutt Oct 20 '10 at 21:20
My website has widgets and the widgets can be dragged and dropped in the UI. I want to save the changed position of the widget with respect to each user and update it to the last moved/dropped positions of the widgets respectively when the user logs in again. How will i save the widgets changed position and update it the next time user logs in.I want this to be done in wordpress. – MsManiya Oct 21 '10 at 8:34

If each user is registered as a WordPress user (and thus exists in the users table), you can save user metadata on each reordering operation. You would communicate back to the server via Ajax (via admin-ajax.php, this also works for non-admin stuff). Serialize the current order to a JSON string, send it to the server to save it, and when the user visits again read this value and order the widgets according to it.

share|improve this answer

Your Answer


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.