Fix warnings in menu.php when plugins.php is enabled for non-supes. Props PeteMall. fixes #17702

git-svn-id: http://svn.automattic.com/wordpress/trunk@18169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2011-06-06 16:59:24 +00:00
parent 2de8d4818d
commit ebdc0d02b6
1 changed files with 5 additions and 4 deletions

View File

@ -174,11 +174,12 @@ function _add_themes_utility_last() {
add_submenu_page('themes.php', _x('Editor', 'theme editor'), _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php'); add_submenu_page('themes.php', _x('Editor', 'theme editor'), _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php');
} }
$menu_perms = get_site_option('menu_items', array()); $menu_perms = get_site_option( 'menu_items', array() );
if ( ! is_multisite() || is_super_admin() || ! empty( $menu_perms['plugins'] ) ) { if ( ! is_multisite() || is_super_admin() || ! empty( $menu_perms['plugins'] ) ) {
$count = "<span class='update-plugins count-$plugin_update_count'><span class='plugin-count'>" . number_format_i18n($plugin_update_count) . "</span></span>"; $count = '';
if ( is_multisite() || ! current_user_can( 'update_plugins' ) ) if ( ! is_multisite() && current_user_can( 'update_plugins' ) )
$count = ''; $count = "<span class='update-plugins count-$plugin_update_count'><span class='plugin-count'>" . number_format_i18n($plugin_update_count) . "</span></span>";
$menu[65] = array( sprintf( __('Plugins %s'), $count ), 'activate_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div' ); $menu[65] = array( sprintf( __('Plugins %s'), $count ), 'activate_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div' );
$submenu['plugins.php'][5] = array( __('Installed Plugins'), 'activate_plugins', 'plugins.php' ); $submenu['plugins.php'][5] = array( __('Installed Plugins'), 'activate_plugins', 'plugins.php' );