• I am trying to add a sub-menu to my plug-in’s ad-min menu item with the following code:

    function AtasArtMainMenu() {
    	add_menu_page('Atas Art Editor', 'Atas Art', 'manage_options', 'aaedit', 'AANLUpload', '', 65);
    	
    	add_submenu_page('aaedit', 'Atas Art Editor', 'Remove newsletters', 'manage options', 'aaremove','AANLRemove',99);
    
    }
    
    add_action('admin_menu','AtasArtMainMenu');
    
    function AANLUpload() {
    ...
    }
    
    function AANLRemove() {
    	echo 'Hello';
    }

    The menu item ‘Atas Art’ shows on the admin menu but the submenu is nowhere to be seen.

    • This topic was modified 3 years, 8 months ago by Jan Dembowski.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The capability needs an underscore, so it won’t show.
    Be sure to also check for that capability in your code.

    Thread Starter garyhix

    (@garyhix)

    Mea culpa. Thanks for catching my typo. Works fine now. I should have gotten the LARGE PRINT edition of WordPress.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add sub-menu not working’ is closed to new replies.