Dashboard menu placement hides theme options

Hi. Since there were no menu items for the dashboard plugin, the only way to access it was via the dashboard, which I didn't like, so I downgraded back to the updates plugin. I just accidentally upgraded to the latest version of the dashboard plugin, and now there is a menu item for WPMU DEV. That's great, but now my theme's options menu is MIA. So I guess the theme's menu was hiding the WPMU menu? But now it is the other way around. The theme is Vantage by AppThemes http://www.appthemes.com/themes/vantage/
Before I downgrade back to the updates plugin once again, I thought I'd share this with you. I'll hold off on the downgrade until Friday, in case you need more info.


    Hi @dubya

    Thank you for sharing this information with us. Any chance that you can send us a screenshot of what it currently looks like when you have the WPMU DEV Dashboard active (hiding the Vantage menu)?

    I will in any case go ahead and ping our Developer on this one to see if he has a quick solution for this.

    Have a good day and talk soon again.



    Or better provide access to your site so I can check out what is happening. One change in the recent version was to hide the Themes and Plugin sub menus under the WPMU DEV Dashboard section if you have DISALLOW_FILE_MODES defined in your wp-config.php But this should not effect the main WordPress Appearances > Theme page.

    You can sent access info to paul [at] incsub.com



    @dubya, So logged into your site. I'm not seeing the WPMU DEV menu but I do see the Vantage menu just below the WordPress Dashboard menu. Thinking this might be a conflict between the plugin and the theme. Any chance you can sent me the theme as a zip file? Then I can debug locally under my own test environment.


    @dubya, ok figured this out. So in the theme look for the file
    /vantage/framework/scb/AdminPage.php line 325-326. Here is the start of the function

    function page_init() {
    extract( $this->args );

    if ( ! $toplevel ) {
    $this->pagehook = add_submenu_page( $parent, $page_title, $menu_title, $capability, $page_slug, array( $this, '_page_content_hook' ) );
    } else {
    $func = 'add_' . $toplevel . '_page';
    $this->pagehook = $func( $page_title, $menu_title, $capability, $page_slug, array( $this, '_page_content_hook' ), $icon_url, $position );

    Some some code explanations. The first part of the If checked a flag to see if they are building a submenu panel or top-level. If submenu as you can see they use the proper WordPress add_submenu_page(); function. So if I'm adding a new menu item to the Settings sections.

    If they are NOT adding a submenu then we go into the else part. Here they SHOULD be using the standard (and recommended) WordPress function add_menu_page(); which lets you add your own top-level menus. http://codex.wordpress.org/Function_Reference/add_menu_page But for some reason the theme developer is overriding this to insert their own menu.

    Compare this to the WPMU DEV Dashboard code in update-notifications.php line 999 where we are properly adding the top-level menu

    $page = add_menu_page( __('WPMU DEV Dashboard', 'wpmudev'), __('WPMU DEV', 'wpmudev') . $count_output, 'manage_options', 'wpmudev', array( &$this, 'dashboard_output'), $this->plugin_url.'/includes/images/icon.png', 3 );

    If you have any sway over the theme developers they try and recommend they do the proper way. But I can almost tell you they won't make a change. Most developers, plugin and theme who really want their code's top-level menu to be the second one just under the main Dashboard do all sort of crazy things to achieve that solutions. I've seen similar things done with the Dashboard panels. Everyone wants to be in the top position. Anyway, sorry this didn't come to a better solution.


    So apparently this is a WordPress bug. Here's the response from AppThemes:

    What the WPMU plugin does:

    $page = add_menu_page( __('WPMU DEV Dashboard', 'wpmudev'), __('WPMU DEV', 'wpmudev') . $count_output, 'manage_options', 'wpmudev', array( &$this, 'dashboard_output'), $this->plugin_url.'/includes/images/icon.png', 3 );

    What APP_Dashboard does:

    extract( wp_parse_args( $args, array(
        'page_slug' => 'app-dashboard',
        'toplevel' => 'menu',
        'position' => 3,
        'screen_icon' => 'themes',
    ) ) );
    $func = 'add_' . $toplevel . '_page';
    $this->pagehook = $func( $page_title, $menu_title, $capability, $page_slug, array( $this, '_page_content_hook' ), $icon_url, $position );

    So both use the existing API correctly, but because both pass $position = 3, one overwrites the other. This is a limitation in the admin menu API and I hope to get it fixed eventually in Core: