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 chosen from a variety of menus for my application only one and it was a wordpress 3.0.1 admin panel menu, but I can't get pass the functionality of it.

If to be more distinct I can't understand how the sliding in this menu work. Is there a jQuery function for every element of the menu or they made it with no link to the specific menu item and how does it remember the state (is menu item open or closed)?

I hope I asked this question in the correct place. Thank you all for help.

share|improve this question
up vote 1 down vote accepted

It's a rather open ended question...

Basically, the core menu functionality are in:

  • wp-amin/menu.php (initialize/display)
  • wp-admin/js/common.dev.js (fold/unfold and store state scripts)
  • wp-admin/includes/plugin.php (functions that allow plugins to add extra items)

But these then make use of a wide variety of other WP functionality. If your goal is to create menu code for a separate app, as I'm suspecting, you're in for copying entire chunks of the WP code base so you might as well use WP altogether.

share|improve this answer
Okey. So I found setUserSetting( 'm'+i, v ); and I guess, that this is used for saving state and here in function restoreMenuState they use var v = getUserSetting( 'm'+i ); for using this state, but I can't find where are those functions. – Eugene Nov 2 '10 at 12:28
a cursory grep locates it in wp-admin/js/utils.dev.js... – Denis de Bernardy Nov 2 '10 at 12:31
Hmmm. So it seems they are using cookies. Well in that case I will stop on what I have implemented already and other data I will save via ajax in cookies to. :) Thanks a lot. – Eugene Nov 2 '10 at 14:28

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.