Add menu and submenu to administrator panel

If you are beginner in WordPress plugin development, you might be interested in technique how to add menu and submenu to administrator dashboard. If so, this tutorial is for you. We are going to add new menu to administrator panel using two functions: add_menu_page() and add_submenu_page().

Below you can see the code which adds new menu item “My Plugin” and three submenu items: “Settings”, “Items”, “Add Item”.

Also, we have to create three functions to display pages associated with menu/submenu items.

Once inserted into plugin, the code generates new menu in administrator panel, like that:
Add menu and submenu to administrator panel
That’s it! 🙂

Comments are closed.

Login Contact Me Any Widgets Social Subscribe
×
 
Thank you for subscription!
×
 
Thank you! Your message has been submitted to us.
×

Calendar

March 2019
M T W T F S S
« Nov    
 123
45678910
11121314151617
18192021222324
25262728293031
×
×
×