• I realize the big game is about to start but, hopefully, there is still someone that might be able to help me with this…

    I am fairly new at WordPress and have added a menu item for my plugin’s configuration into the dashboard menu by hacking some examples. The problem is that it is creating a link out of its heading when there doesn’t need to be one.

    Details … The name of the pluggin is “BungeeBones” so after installation I want a menu heading in the Dashboard saying “BungeeBones” (which it correctly displays now). When one mouses over it (or clicks it) a dropdown of the four pages (correctly) is there but it also lists again the heading “BungeeBones” as a page link even though there is no such page.

    How can I get the “BungeeBones” page link out of the list but leave it as a header? I realize it is the “add_menu”page” line but can’t seem to come up with the right code to not also show up as a menu item.

    Thanks!

    Here is the code I am using …

    function bb_menu() {
    add_menu_page( 'bungeebones', 'Bungeebones', 'edit_pages', 'bungeebones', array(&$this, 'mainAdmin'), null, 10, 'admin/bb_home');
    add_submenu_page('bungeebones', 'Bungeebones Instructions', 'Instructions', 'edit_pages', 'bungeebones-instructions', 'bb_instructions');
    add_submenu_page('bungeebones', 'Bungeebones Registered', 'Registered', 'edit_pages', 'bungeebones-registered',  'bb_registered');
    add_submenu_page('bungeebones', 'Bungeebones Non_Registered', 'Non_Registered', 'edit_pages', 'bungeebones-non_registered',  'bb_non_registered');
    add_submenu_page('bungeebones', 'Bungeebones Styles', 'Styles', 'edit_pages', 'bungeebones-styles', 'bb_styles');
    }
    
    function bb_instructions() {
    	include("admin/bb_instructions.php");
    }
    function bb_registered() {
    	include("admin/bb_registered.php");
    }
    function bb_non_registered() {
    	include("admin/bb_non_registered.php");
    }
    function bb_styles() {
    	include("admin/bb_styles.php");
    }
    
    add_action('admin_menu', 'bb_menu');

  • The topic ‘Menu code’ is closed to new replies.