Support » Plugins and Hacks » Plugin Menus and submenus

Plugin Menus and submenus

  • Hi

    I’m writing a plugin that requires a few subpages.
    I have my initial defined like this:

    add_action('admin_menu', 'acme_menu');
    function acme_menu() {
    	add_menu_page('Acme', 'Acme', 'manage_options', 'acme', 'acme_events');

    This works fine and I display the content with acme_events.

    Now I’m trying to create a sub-menu like this

    function acme_sub_menu() {
    	add_submenu_page('acme', 'Import Acme Event', 'Import Acme Event', 'manage_options', 'import-event', 'import_event');

    The menu appears, but the slug is wrong – it shows ‘wp-admin/import-event’ instead of ‘?page=import-event’ – clicking it gives me a frontend 404.

    What am I doing wrong?

    I hope someone can help me as I have not had much luck with these forums. I’ve posted numerous equally urgent questions that remain
    Are there any OTHER wordpress forums?

Viewing 1 replies (of 1 total)
  • Fixed it.
    Was importing the sub page and ultimately calling the sub menu BEFORE the main menu. Still showed, but now the link works…who knows…ah well…RESOLVED.

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin Menus and submenus’ is closed to new replies.