Allow the 'WordPress Updates' page to be accessible even if you cannot update core, as long as you can update plugins or themes. fixes #21124.

git-svn-id: http://core.svn.wordpress.org/trunk@21199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin
2012-06-30 12:54:05 +00:00
parent 9d20dfc4e1
commit fbd46fbc8c
2 changed files with 27 additions and 15 deletions

View File

@@ -34,7 +34,14 @@ if ( ! is_multisite() || is_super_admin() )
$update_data = wp_get_update_data();
if ( ! is_multisite() ) {
$submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-{$update_data['counts']['total']}' title='{$update_data['title']}'><span class='update-count'>" . number_format_i18n($update_data['counts']['total']) . "</span></span>" ), 'update_core', 'update-core.php');
if ( current_user_can( 'update_core' ) )
$cap = 'update_core';
elseif ( current_user_can( 'update_plugins' ) )
$cap = 'update_plugins';
else
$cap = 'update_themes';
$submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-{$update_data['counts']['total']}' title='{$update_data['title']}'><span class='update-count'>" . number_format_i18n($update_data['counts']['total']) . "</span></span>" ), $cap, 'update-core.php');
unset( $cap );
}
$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );