Custom Plugin Top-Level Menu Not Working as Expected
-
I have created a custom plugin, and for that plugin a new top-level menu with the following code:
add_action('admin_menu', 'md_plugin_menu'); function md_plugin_menu() { add_menu_page('Member Directory', 'Member Directory', 9, 'member-directory-plugin', 'md_plugin_page'); add_submenu_page('member-directory-plugin', 'List Members', 'List Members', 9, 'member-directory/list_members.php'); add_submenu_page('member-directory-plugin', 'Add Member', 'Add Member', 9, 'member-directory/add_member.php'); add_submenu_page('', 'Edit Member', 'Edit Member', 9, 'member-directory/edit_member.php'); }
This works just fine, EXCEPT that I’m getting a sub-menu item with the title “Member Directory” under the top-level menu titled “Member Directory.” Can anyone tell me what I’m doing wrong here?
Thanks, Dan
- The topic ‘Custom Plugin Top-Level Menu Not Working as Expected’ is closed to new replies.