diff --git a/wp-admin/menu.php b/wp-admin/menu.php index 60e19c1bbf..0ea4794488 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -168,9 +168,11 @@ if ( is_super_admin() || ( is_multisite() && isset($menu_perms['plugins']) && $m $submenu['plugins.php'][5] = array( __('Installed'), 'activate_plugins', 'plugins.php' ); /* translators: add new plugin */ $submenu['plugins.php'][10] = array(_x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php'); - $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' ); + $plugins = get_plugins(); + if( !empty($plugins) ) + $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' ); } -unset($menu_perms, $update_plugins, $update_count); +unset($menu_perms, $update_plugins, $update_count, $plugins); if ( current_user_can('list_users') ) $menu[70] = array( __('Users'), 'list_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'div' ); diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php index 2aa879c48d..54ad5d1b39 100644 --- a/wp-admin/plugin-editor.php +++ b/wp-admin/plugin-editor.php @@ -10,7 +10,7 @@ require_once('./admin.php'); if ( !current_user_can('edit_plugins') ) - wp_die('
'.__('You do not have sufficient permissions to edit plugins for this blog.').'
'); + wp_die( __('You do not have sufficient permissions to edit plugins for this site.') ); $title = __("Edit Plugins"); $parent_file = 'plugins.php'; @@ -21,6 +21,9 @@ wp_admin_css( 'theme-editor' ); $plugins = get_plugins(); +if( empty($plugins) ) + wp_die( __('There are no plugins installed on this site.') ); + if ( isset($_REQUEST['file']) ) $plugin = stripslashes($_REQUEST['file']);