Support » Plugins » Hacks » Plugin Menu Naming

  • Hi folks,

    I hope this is a simple question to answer. First, let me give some brief context before asking the question.

    The built-in WordPress admin menus function in a way that the main menu title points to the first submenu item. An example is the Settings menu. When you click on the Settings menu, it displays the General Settings page and highlights the first submenu item entitled “General.” Visually, this is what I am talking about (the menu items are displayed in bold below):

    – General

    – Writing
    – Reading

    I want to achieve this same functionality with my plugin menu, but my first submenu item is the same name as the entire plugin menu. How do I change it? Below is a visual representation of the results I see:

    – Custom

    – Misc. Settings

    The code I am using is found below:

    function custom_plugin_menu()
    	add_menu_page('Custom', 'Custom', 'manage_options', 'custom-plugin', 'custom_option_page');
    	add_submenu_page('custom-plugin','Misc. Settings', 'Misc. Settings', 'manage_options', 'custom-plugin2', 'custom_option_page2');
    add_action('admin_menu', 'custom_plugin_menu');

    Thanks for any help in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin Menu Naming’ is closed to new replies.