Uninstall, Activate, Deactivate a plugin: typical features & how-to

There are three different hooks. They trigger in the following cases: Uninstall Deactivation Activation How-to trigger functions safely during the scenarios The following shows the right ways to safely hook callback functions that get triggered during the mentioned actions. As you could use this code in a plugin that uses plain functions, a class or … Read more

add_menu_page() with different name for first submenu item

You can make the ‘slug’ for the submenu page equal that of the top level page, and they’ll point to the same place: add_action(‘admin_menu’, ‘my_menu_pages’); function my_menu_pages(){ add_menu_page(‘My Page Title’, ‘My Menu Title’, ‘manage_options’, ‘my-menu’, ‘my_menu_output’ ); add_submenu_page(‘my-menu’, ‘Submenu Page Title’, ‘Whatever You Want’, ‘manage_options’, ‘my-menu’ ); add_submenu_page(‘my-menu’, ‘Submenu Page Title2’, ‘Whatever You Want2’, ‘manage_options’, … Read more