Redirect plugins that hard code their pages to be under edit.php. Props filosofo. fixes #7932

git-svn-id: http://svn.automattic.com/wordpress/trunk@9264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-10-21 16:31:06 +00:00
parent b44779df6c
commit e6641a0268
1 changed files with 7 additions and 1 deletions

View File

@ -57,8 +57,14 @@ do_action('admin_init');
// Handle plugin admin pages.
if (isset($plugin_page)) {
if( ! $page_hook = get_plugin_page_hook($plugin_page, $pagenow) )
if( ! $page_hook = get_plugin_page_hook($plugin_page, $pagenow) ) {
$page_hook = get_plugin_page_hook($plugin_page, $plugin_page);
// backwards compatibility for plugins using add_management_page
if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook($plugin_page, 'import.php') ) {
wp_redirect('import.php?page=' . $plugin_page);
exit;
}
}
if ( $page_hook ) {
do_action('load-' . $page_hook);