WP Plugin Menu hides when visiting an invisible sub-menu

I am writing a plugin for WordPress.

There I have the following menu structure:

Read More
  • Plugin-Name

    • Plugin sub-page
    • Plugin sub-page
    • Plugin sub-page
      • invisible Plugin sub-page

To create the invisible plugin sub-page I used this code:

//plugin sub-page
add_submenu_page( 'plugin-main-page', 'Plugin sub-page', 'Plugin sub-page', 'manage_options', 'plugin-sub-page', array(&$this->sub-page, 'showContent') );

//invisible plugin sub-page
add_submenu_page( 
      'plugin-sub-page'
    , 'My Custom Submenu Page' 
    , 'My Custom Submenu Page'
    , 'manage_options'
    , 'my-custom-submenu-page'
    , array(&$this->custom-sub-page, 'showContent')
);

Everything works. But:

When I use the link

<a href='?page=my-custom-submenu-page'>

at the ‘plugin sub-page’ the main plugin-menu hides.

Is it possible that the ‘plugin sub-page’ is still highlighted?

Related posts

Leave a Reply