• Resolved eynugget

    (@eynugget)


    Great framework!

    I have multiple plugins that work in concert. So, I’d like to have their submenu pages be under the same root menu.

    Each of the plugins calls this in their respective classes:
    $this->setRootMenuPage(“my admin”);

    But, what ends up happening is multiple “my admin” menus in the admin menu, one for each plugin.

    Seems to work fine if I use root menu “Settings”, but not if I use my own root menu name.

    Any suggestions? Thanks.

    https://ww.wp.xz.cn/plugins/admin-page-framework/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author miunosoft

    (@miunosoft)

    Hi,

    Check out the following FAQ item:

    How can I add sub-menu pages to the top-level page created by the framework in a separate script?

    You need to use the setRootMenuPageBySlug() method and pass the main plugin’s extended admin class name.

    Hope it helps!

    Thread Starter eynugget

    (@eynugget)

    Awesome! thanks.

    Thread Starter eynugget

    (@eynugget)

    how do you check if root menu instance exists?
    Thanks,
    Eric

    Plugin Author miunosoft

    (@miunosoft)

    Hi,

    Registered root menu items are stored in the $admin_page_hooks global variable.

    So you can do something like this.

    function doesRootMenuExist( $sSlug ) {
        return isset ( $GLOBALS['admin_page_hooks'][ $sSlug ] );
    }

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘multiple plugins using the framework – duplicate admin menu items’ is closed to new replies.