WordPress add_submenu_page gives incorrect url

I have a bug I can’t seem to resolve.
I have this line in a statically written class:

add_submenu_page( 
    'ib_inbound_main',
    'Analyics Configuration',
    'Analytics',
    'edit_pages',
    'ib_analytics_config',
    array ('ib_analytics_admin_panels', 'render_config_panel')
);

Which is generating this link:

Read More
<a href="ib_analytics_config" class="wp-first-item">Analytics</a>

Which is missing admin.php?page=
Can anyone see why this is occurring?

Related posts

Leave a Reply

1 comment

  1. The reason the URL was generated incorrectly is because I was trying to create the submenu page before the main menu item existed.

    It should have been obvious but I was thrown off the scent because the menu appeared to otherwise generate correctly – I thought that building the admin menus out of sequence would have white screened WordPress.