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:
@@ -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' );
|
||||
|
||||
Reference in New Issue
Block a user