mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-25 01:31:27 +01:00
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:
parent
bd5457487a
commit
6d49900723
@ -127,7 +127,25 @@ do_action('_admin_menu');
|
|||||||
|
|
||||||
// Create list of page plugin hook names.
|
// Create list of page plugin hook names.
|
||||||
foreach ($menu as $menu_page) {
|
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();
|
$_wp_submenu_nopriv = array();
|
||||||
|
Loading…
Reference in New Issue
Block a user