Support » Plugins » Admin Menu Help

  • All,

    Been struggling with adding a custom plugin. Been following HOWTOs from:,,,,,,,,,

    I tried all the commands, with no errors, but even though I can register and activate my plugin, I can not get the Admin Menu or submenu items to write into my WP session.

    I’m workdering if the commands changed in 3.2.1 as, looking through all the code for my other plugins, that do add to the Admin Menu, I do not find the commands specified in any of these HOWTOs.

    All help appreciated!



Viewing 3 replies - 1 through 3 (of 3 total)
  • All,

    Can I get some help?

    The commands:


    are not working at all!


    Can you provide some more details and perhaps a list of what you’ve been trying and/or sample code?

    When are you calling those functions? It should be after the right routines are loaded but before the page output begins. Ideally, use something like:

    add_action( 'admin_menu', 'myplugin_menus' );
    function myplugin_menus() {
      add_menu_page( ... ); //Fill proper arguments in..
      add_submenu_page( ... ); //Fill proper arguments in..

    If you are trying to extend another plugin’s menu, make sure you’re creating your submenus after they create theirs. Try using a lower priority (higher number..) for the admin_menu action.

    Finally, turn on debug mode so that you can see every little thing that’s going on. Good luck.


    Hey I found out that the syntax is soooo very specific and none of the codex HOWTOs even talk about it. Here is what I had to do with my code to get it to work:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Item 1-3 were just experimental, the real one I was trying to do is #4.

    It finally worked when all the code was right. Putting the values into vars and then dropping them into the commands was really helpful, but had to figure that out on my own, because none of the HOWTOs in the codex or elsewhere did that.

    Still got some other errors, but not related to getting these commands working.



Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Admin Menu Help’ is closed to new replies.