0

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.

1 Answer 1

1

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.

3
  • 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
    Commented Nov 2, 2010 at 12:28
  • a cursory grep locates it in wp-admin/js/utils.dev.js... Commented Nov 2, 2010 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
    Commented Nov 2, 2010 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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