mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Redirect plugins that hard code their pages to be under edit.php. Props filosofo. fixes #7932
git-svn-id: https://develop.svn.wordpress.org/trunk@9264 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user