Guest User

Untitled

a guest
Jan 23rd, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. $menu_slug = "my_menu_slug";
  2. $desired_capability = "manage_options"; //Or whatever you need
  3. $menu_page_callback = "menu_page_callback_function";
  4.  
  5. add_menu_page(
  6. "Page Title",
  7. "Menu Title",
  8. $desired_capability,
  9. $menu_slug,
  10. $menu_page_callback
  11. );
  12.  
  13. add_submenu_page(
  14. $menu_slug,
  15. "Submenu Page Title",
  16. "Submenu Menu Title",
  17. $desired_capability,
  18. $menu_slug,
  19. $menu_page_callback
  20. );
  21. //Note, the 5th and 6th parameters here are the same as above. This
  22. //overrides the first submenu title. Now clicking the
  23. //menu title and the first submenu item will navigate to the same page,
  24. //generated by the menu_page_callback function.
Add Comment
Please, Sign In to add comment