Add to collection
Md Riyazuddin

Md Riyazuddin

Verified

How do you add a WordPress admin page without adding it to the menu.

It is very possible to make a page cannot be reach via sub-menu, or even the main menu in the WP admin panel.


    global $_registered_pages;

    $menu_slug = plugin_basename('myplugin.php');//here you can add your slug which you wanna be.
    $hookname = get_plugin_page_hookname($menu_slug,'');
    if (!empty($hookname)) {
        add_action($hookname, 'myplugin_render_edit_page');//add your function name to show page where you wanna be. 
    }
    $_registered_pages[$hookname] = true;

References and Credits

Tagged with: wordpress

Comments 0

  • Sorry!! No comment posted yet. Become the first user to give comment.
Add a comment

Would you like to write for w3 sniff?

Become part of an amazing group of contributors and authors and start writing for us

Join Now
    global $_registered_pages;

    $menu_slug = plugin_basename('myplugin.php');//here you can add your slug which you wanna be.
    $hookname = get_plugin_page_hookname($menu_slug,'');
    if (!empty($hookname)) {
        add_action($hookname, 'myplugin_render_edit_page');//add your function name to show page where you wanna be. 
    }
    $_registered_pages[$hookname] = true;
Feedback submitted successfully.