Hook name back-compat from Denis-de-Bernardy. fixes #9438

git-svn-id: http://svn.automattic.com/wordpress/trunk@11032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-04-21 19:49:56 +00:00
parent bd5457487a
commit 6d49900723
1 changed files with 19 additions and 1 deletions

View File

@ -127,7 +127,25 @@ do_action('_admin_menu');
// Create list of page plugin hook names.
foreach ($menu as $menu_page) {
$admin_page_hooks[$menu_page[2]] = sanitize_title(basename($menu_page[2], '.php'));
$hook_name = sanitize_title(basename($menu_page[2], '.php'));
// ensure we're backwards compatible
$compat = array(
'index' => 'dashboard',
'edit' => 'posts',
'upload' => 'media',
'link-manager' => 'links',
'edit-pages' => 'pages',
'edit-comments' => 'comments',
'options-general' => 'settings',
);
if ( isset($compat[$hook_name]) )
$hook_name = $compat[$hook_name];
elseif ( !$hook_name )
continue;
$admin_page_hooks[$menu_page[2]] = $hook_name;
}
$_wp_submenu_nopriv = array();