Don't call get_plugins() in menu.php. It is too slow to call on every admin page load. fixes #13117
git-svn-id: https://develop.svn.wordpress.org/trunk@14299 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
cbe8327f39
commit
616f48e89d
|
@ -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' );
|
$submenu['plugins.php'][5] = array( __('Installed'), 'activate_plugins', 'plugins.php' );
|
||||||
/* translators: add new plugin */
|
/* translators: add new plugin */
|
||||||
$submenu['plugins.php'][10] = array(_x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php');
|
$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') )
|
if ( current_user_can('list_users') )
|
||||||
$menu[70] = array( __('Users'), 'list_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'div' );
|
$menu[70] = array( __('Users'), 'list_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'div' );
|
||||||
|
|
|
@ -21,7 +21,7 @@ wp_admin_css( 'theme-editor' );
|
||||||
|
|
||||||
$plugins = get_plugins();
|
$plugins = get_plugins();
|
||||||
|
|
||||||
if( empty($plugins) )
|
if ( empty($plugins) )
|
||||||
wp_die( __('There are no plugins installed on this site.') );
|
wp_die( __('There are no plugins installed on this site.') );
|
||||||
|
|
||||||
if ( isset($_REQUEST['file']) )
|
if ( isset($_REQUEST['file']) )
|
||||||
|
|
Loading…
Reference in New Issue