Admin pages are basically spokenthing else then a hook to a function, so it is technicallyt a problem to add your own pages without making use of the menu.

I wast aware of an API function that allows you to register own pages with ease, but there is a helper function in Wordpress you can make use of: get_plugin_page_hookname() (undocumented function). Next to that, the hook needs to be registered in a global registry of all page hooks ( $GLOBALS['_registered_pages'] ) so that it's rated valid when the page is requested.

I've wrapped that in some sample code, just save it into your /wp-content/mu-plugins folder: admin_page_demo.php (Wordpress MU-Plugin Example)

In there you can find a function register_admin_page() that can register any callback you need per the admin_menu hook. That's the important one, compare to Adding Administration Menus (Wordpress Codex) .

The function returns the URL of the new admin page. You wrote that you might need to add more parameters, so I thought that might be handy.

For the demo page I hardcoded into that example, the URL is: /wp-admin/options-general.php?page=adminpagedemo_demo_page .

Keep in mind, that you need to check for security for that page on your own because Wordpress doest. Something like



current_user_can( ... );
wp_die( __('You dot have sufficient permissions to access this page.') );

might be a helpful additional hint.


More Solution