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

Md Riyazuddin Verified
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

Comments

Leave a Comment