From bc60e6967ab4a7f4bf04d983279242bad35fe6d2 Mon Sep 17 00:00:00 2001 From: dd32 Date: Sun, 21 Mar 2010 01:01:45 +0000 Subject: [PATCH] Do not display empty Appearance menu for subscribers. Need to use Menu API after the _admin_menu hook has fired. git-svn-id: http://svn.automattic.com/wordpress/trunk@13783 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/menu.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/menu.php b/wp-admin/menu.php index a5f497378..fc00b1fee 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -141,8 +141,8 @@ $menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-to // Add 'Editor' to the bottom of the Appearence menu. add_action('admin_menu', '_add_themes_utility_last', 101); function _add_themes_utility_last() { - global $submenu; - $submenu['themes.php'][] = array(_x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php'); + // Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook + add_submenu_page('themes.php', _x('Editor', 'theme editor'), _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php'); } $update_plugins = get_site_transient( 'update_plugins' );