Don't call get_plugins() in menu.php. It is too slow to call on every admin page load. fixes #13117

git-svn-id: http://svn.automattic.com/wordpress/trunk@14299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-04-29 16:38:12 +00:00
parent 7629767c24
commit acd118c1be
2 changed files with 3 additions and 5 deletions

View File

@ -168,11 +168,9 @@ 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');
$plugins = get_plugins();
if( !empty($plugins) )
$submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
$submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
}
unset($menu_perms, $update_plugins, $update_count, $plugins);
unset($menu_perms, $update_plugins, $update_count);
if ( current_user_can('list_users') )
$menu[70] = array( __('Users'), 'list_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'div' );

View File

@ -21,7 +21,7 @@ wp_admin_css( 'theme-editor' );
$plugins = get_plugins();
if( empty($plugins) )
if ( empty($plugins) )
wp_die( __('There are no plugins installed on this site.') );
if ( isset($_REQUEST['file']) )