Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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 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
add comment

Your Answer

 
discard

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.