add_submenu_page isn't working
-
Hi,
I’m making a custom menu page for a plugin, since the plugin has an own concept for my client.
Now, I’ve created a top level called MP3 Music Player and under there I’ll need 2 sub menu’s, overview and administer (can change in the futur).
Now I’ve this for creating the top level:
add_menu_page('Flash MP3 Music Player', 'MP3 Music Player', 'manage_options', 'fl_player_overview.php', 'fl_player_overview');
And I’ve got this for the submenu’s:
add_submenu_page('Flash MP3 Music Player', 'MP3 Music Player Overview', 'MP3 Overview', 'manage_options', 'fl_player_overview.php', 'fl_player_overview'); add_submenu_page('Flash MP3 Music Player', 'MP3 Music Player Overview', 'Add new MP3', 'manage_options', 'fl_player_admin.php');
Here’s the entire code:
function fl_player_overview(){ if (!current_user_can('manage_options')) { wp_die( __('You do not have sufficient permissions to access this page.') ); } require('fl_player_overview.php'); } function fl_player_admin_actions(){ add_menu_page('Flash MP3 Music Player', 'MP3 Music Player', 'manage_options', 'fl_player_overview.php', 'fl_player_overview'); add_submenu_page('Flash MP3 Music Player', 'MP3 Music Player Overview', 'MP3 Overview', 'manage_options', 'fl_player_overview.php', 'fl_player_overview'); add_submenu_page('Flash MP3 Music Player', 'MP3 Music Player Overview', 'Add new MP3', 'manage_options', 'fl_player_admin.php'); } add_action('admin_menu', 'fl_player_admin_actions');
The good part is is that he find’s the fl_player_overview page but I don’t get the sublevel menu.
What am I doing wrong here?
Thanks! ??
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘add_submenu_page isn't working’ is closed to new replies.