Reputation: 1927
I am having this problem that I have a Plugin which has two sub menus: Escape Submitter and Event Submitter. But the thing is I created the Plugin pages like this:
add_action( 'admin_menu', 'my_plugin_menu' );
function my_plugin_menu() {
add_menu_page('Submission Requests', "Submission Requests", 'add_users',"submission-requests/show.php",'',PRO_URL."/images/icon.png",27);
add_submenu_page( 'submission-requests/show.php', "Escape Submitter", "Escape Submitter", 'manage_options', 'escape_submit','escapeSub' );
add_submenu_page( 'submission-requests/show.php', "Event Submitter", "Event Submitter", 'manage_options', 'event_submit','eventSub' );
}
and it Look like this in Wordpress plugin Page
But the thing is that I don't want to add the main menu page 'Submission Requests' to show in the main menu I just want to see something like this:
How can I do this do I have to call other type of add_menu_page
function? Or do I have to give some parameters to the same. Because I want to show Escape Submitter as first Page when a user clicks on my Plugin.
P.S: Sorry for my Bad English i hope you understood the problem and please forget about those Numberings after those Menu Names
Upvotes: 0
Views: 382
Reputation: 703
You add_menu_page slug and your first add_submenu_page slug need to be the same.
For example:
public function RWSDevBlip_add_admin_menu() {
add_menu_page('Blip.tv Interface','Blip.tv API','manage_options','rwsdev-blip',array($this,'RWSDevBlip_admin_page'),$this->pluginurl.'images/RWSDevBlip.png',3);
add_submenu_page('rwsdev-blip','Blip.tv Interface Options','Settings','manage_options','rwsdev-blip',array($this,'RWSDevBlip_admin_page'));
add_submenu_page('rwsdev-blip','Blip.tv Interface Upload','Upload','manage_options','rwsdev-blip-upload',array($this,'RWSDevBlip_upload_page'));
add_submenu_page('rwsdev-blip','Blip.tv Interface Videos','Videos','manage_options','rwsdev-blip-videos',array($this,'RWSDevBlip_videos_page'));
}
Hope this helps.
Upvotes: 1