Plugin Development: New top level menu creates identical submenu. Fix?
-
I’m working on a plugin and I’ve created a new top-level menu. The top-level menu is called ‘XML Editor’. My code creates this just fine. The problem is that there is also a sub-menu created with the same name ‘XML Editor’. I don’t need this, but I can’t make it go away. I’m sure it’s something simple, I’m fairly new to plugin development.
Here is the code that creates the menus:
function xml_test_menu() { add_menu_page(__('Playlist','menu-test'), __('XML Editor','menu-test'), 'manage_options', 'larrys_xml_editor', 'xml_edit_top_level' ); add_submenu_page('larrys_xml_editor', __('Add A Video','menu-test'), __('Add A Video','menu-test'), 'manage_options', "xml-add-video", "xml_add_video"); add_submenu_page('larrys_xml_editor', __('Delete A Video','menu-test'), __('Delete A Video','menu-test'), 'manage_options', 'xml-edit-video', 'xml_edit_video'); }
I only want a top-level menu called ‘XML Editor’ with no sub-menu of the same name. Gigpress and other plugins are set up like this, but looking through the code I can’t see what I’m doing wrong. Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Plugin Development: New top level menu creates identical submenu. Fix?’ is closed to new replies.