WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created a settings page that's being displayed in the options menu like this:

    'ATB Event Options',
    'ATB Event Options',

Instead, I'd like to display it as a menu item under another parent menu with the slug 'mvc_events':

    'ATB Event Options',
    'ATB Event Options',

While that does add "ATB Event Options" to my mvc_events menu, it overwrites the first menu item I had there, and the link doesn't even work. The link is generated as blah.dev/wp-admin/atb-event-options.

Any idea what I'm doing wrong?

share|improve this question

You'd need to create the top-level menu page, and then the sub-menu after that.

Here's an example:

function my_menu() {
  add_menu_page ( 
    'MVC Events',      // $page_title
    'MVC Events',      // $menu_title
    'manage_options',  // $capability
    'mvc-events',      // $menu_slug
    'mvc-options'      // $function
  add_submenu_page (
    'mvc-events',         // $parent_slug
    'ATB Event Options',  // $page_title
    'ATB Event Options',  // $menu_title
    'manage_options',     // $capability
    'atb-event-options',  // $menu_slug
    'atb-options'         // $function
add_action( 'admin_menu', 'my_menu' );

Here's the pertinent WP codex file, and one particularly on sub-menus.

share|improve this answer
Yeah, but I'm using WP-MVC which generates menus by default and I can't override it. So I'm guessing I'm screwed. – dallen Aug 7 '13 at 2:26
Gotcha. Yeah, I'd suggest contacting Tom Benner, the developer, directly then. His contact is available online. – bulldog Aug 7 '13 at 17:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.