Ticket #25219: 25219.4.diff
File 25219.4.diff, 22.6 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/theme.php
124 124 */ 125 125 function get_theme_update_available( $theme ) { 126 126 static $themes_update; 127 128 if ( ! current_user_can('update_themes' ) )127 128 if ( ! current_user_can( 'view_theme_updates' ) ) { 129 129 return false; 130 130 } 131 131 132 if ( !isset($themes_update) ) 132 133 $themes_update = get_site_transient('update_themes'); 133 134 … … 396 397 } 397 398 398 399 $updates = array(); 399 if ( current_user_can( ' update_themes' ) ) {400 if ( current_user_can( 'view_theme_updates' ) ) { 400 401 $updates_transient = get_site_transient( 'update_themes' ); 401 402 if ( isset( $updates_transient->response ) ) { 402 403 $updates = $updates_transient->response; -
src/wp-admin/includes/update.php
162 162 } 163 163 164 164 function core_update_footer( $msg = '' ) { 165 if ( ! current_user_can('update_core') )165 if ( ! current_user_can( 'view_core_updates' ) ) 166 166 return sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) ); 167 167 168 168 $cur = get_preferred_from_update_core(); … … 184 184 break; 185 185 186 186 case 'upgrade' : 187 return sprintf( '<strong>'.__( '<a href="%1$s">Get Version %2$s</a>' ).'</strong>', network_admin_url( 'update-core.php' ), $cur->current); 187 if ( current_user_can( 'update_core' ) ) { 188 return sprintf( '<strong>'.__( '<a href="%1$s">Get Version %2$s</a>' ).'</strong>', network_admin_url( 'update-core.php' ), $cur->current); 189 } else { 190 return sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! Please update now.'), $cur->current ); 191 } 188 192 break; 189 193 190 194 case 'latest' : … … 211 215 212 216 if ( current_user_can('update_core') ) { 213 217 $msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! <a href="%2$s">Please update now</a>.'), $cur->current, network_admin_url( 'update-core.php' ) ); 218 } elseif ( current_user_can( 'view_core_updates' ) ) { 219 $msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! Please update now.'), $cur->current ); 214 220 } else { 215 221 $msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! Please notify the site administrator.'), $cur->current ); 216 222 } … … 223 229 function update_right_now_message() { 224 230 $msg = sprintf( __( 'You are using <span class="b">WordPress %s</span>.' ), get_bloginfo( 'version', 'display' ) ); 225 231 226 if ( current_user_can( 'update_core') ) {232 if ( current_user_can( 'view_core_updates' ) ) { 227 233 $cur = get_preferred_from_update_core(); 228 234 229 if ( isset( $cur->response ) && $cur->response == 'upgrade' ) 230 $msg .= " <a href='" . network_admin_url( 'update-core.php' ) . "' class='button'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>'; 235 if ( isset( $cur->response ) && $cur->response == 'upgrade' ) { 236 if ( current_user_can( 'update_core' ) ) { 237 $msg .= " <a href='" . network_admin_url( 'update-core.php' ) . "' class='button'>" . sprintf( __( 'Update to %s' ), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>'; 238 } else { 239 $msg .= ' ' . sprintf( __( '<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! Please update now.' ), $cur->current ); 240 } 241 } 231 242 } 232 243 233 244 echo "<span id='wp-version-message'>$msg</span>"; … … 248 259 } 249 260 250 261 function wp_plugin_update_rows() { 251 if ( ! current_user_can('update_plugins' ) )262 if ( ! current_user_can( 'view_plugin_updates' ) ) { 252 263 return; 264 } 253 265 254 266 $plugins = get_site_transient( 'update_plugins' ); 255 267 if ( isset($plugins->response) && is_array($plugins->response) ) { -
src/wp-admin/menu.php
34 34 $update_data = wp_get_update_data(); 35 35 36 36 if ( ! is_multisite() ) { 37 if ( current_user_can( ' update_core' ) )38 $cap = ' update_core';39 elseif ( current_user_can( ' update_plugins' ) )40 $cap = ' update_plugins';37 if ( current_user_can( 'view_core_updates' ) ) 38 $cap = 'view_core_updates'; 39 elseif ( current_user_can( 'view_plugin_updates' ) ) 40 $cap = 'view_plugin_updates'; 41 41 else 42 $cap = ' update_themes';42 $cap = 'view_theme_updates'; 43 43 $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'); 44 44 unset( $cap ); 45 45 } … … 161 161 } 162 162 163 163 $count = ''; 164 if ( ! is_multisite() && current_user_can( ' update_plugins' ) ) {164 if ( ! is_multisite() && current_user_can( 'view_plugin_updates' ) ) { 165 165 if ( ! isset( $update_data ) ) 166 166 $update_data = wp_get_update_data(); 167 167 $count = "<span class='update-plugins count-{$update_data['counts']['plugins']}'><span class='plugin-count'>" . number_format_i18n($update_data['counts']['plugins']) . "</span></span>"; … … 173 173 174 174 if ( ! is_multisite() ) { 175 175 /* translators: add new plugin */ 176 $submenu['plugins.php'][10] = array( _x('Add New', 'plugin'), ' install_plugins', 'plugin-install.php' );176 $submenu['plugins.php'][10] = array( _x('Add New', 'plugin'), 'view_plugin_updates', 'plugin-install.php' ); 177 177 $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' ); 178 178 } 179 179 -
src/wp-admin/plugin-install.php
14 14 */ 15 15 require_once( dirname( __FILE__ ) . '/admin.php' ); 16 16 17 if ( ! current_user_can( 'install_plugins') )18 wp_die( __('You do not have sufficient permissions to install plugins on this site.'));17 if ( ! current_user_can( 'view_plugin_updates' ) ) 18 wp_die( __( 'You do not have sufficient permissions to view plugin updates for this site.' ) ); 19 19 20 20 if ( is_multisite() && ! is_network_admin() ) { 21 21 wp_redirect( network_admin_url( 'plugin-install.php' ) ); -
src/wp-admin/update-core.php
18 18 exit(); 19 19 } 20 20 21 if ( ! current_user_can( ' update_core' ) && ! current_user_can( 'update_themes' ) && ! current_user_can( 'update_plugins' ) )22 wp_die( __( 'You do not have sufficient permissions to updatethis site.' ) );21 if ( ! current_user_can( 'view_core_updates' ) && ! current_user_can( 'view_theme_updates' ) && ! current_user_can( 'view_plugin_updates' ) ) 22 wp_die( __( 'You do not have sufficient permissions to view updates for this site.' ) ); 23 23 24 24 function list_core_update( $update ) { 25 25 global $wp_local_package, $wpdb, $wp_version; … … 62 62 $message = sprintf( __('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.'), $update->current, $update->php_version, $php_version ); 63 63 elseif ( !$mysql_compat ) 64 64 $message = sprintf( __('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.'), $update->current, $update->mysql_version, $mysql_version ); 65 else 66 $message = sprintf(__('You can update to <a href="http://codex.wordpress.org/Version_%1$s">WordPress %2$s</a> automatically or download the package and install it manually:'), $update->current, $version_string); 65 else { 66 if ( current_user_can( 'update_core' ) ) { 67 $message = sprintf(__('You can update to <a href="http://codex.wordpress.org/Version_%1$s">WordPress %2$s</a> automatically or download the package and install it manually:'), $update->current, $version_string); 68 } else { 69 $message = sprintf(__('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %2$s</a> is available. Please download the package and install it manually.'), $update->current, $version_string); 70 } 71 } 67 72 if ( !$mysql_compat || !$php_compat ) 68 73 $show_buttons = false; 69 74 } … … 79 84 echo '<input name="version" value="'. esc_attr($update->current) .'" type="hidden"/>'; 80 85 echo '<input name="locale" value="'. esc_attr($update->locale) .'" type="hidden"/>'; 81 86 if ( $show_buttons ) { 82 if ( $first_pass ) { 83 submit_button( $submit, $current ? 'button' : 'primary regular', 'upgrade', false ); 84 $first_pass = false; 85 } else { 86 submit_button( $submit, 'button', 'upgrade', false ); 87 if ( current_user_can( 'update_core' ) ) { 88 if ( $first_pass ) { 89 submit_button( $submit, $current ? 'button' : 'primary regular', 'upgrade', false ); 90 $first_pass = false; 91 } else { 92 submit_button( $submit, 'button', 'upgrade', false ); 93 } 94 echo ' '; 87 95 } 88 echo ' <a href="' . esc_url( $update->download ) . '" class="button">' . $download . '</a> ';96 echo '<a href="' . esc_url( $update->download ) . '" class="button">' . $download . '</a> '; 89 97 } 90 98 if ( 'en_US' != $update->locale ) 91 99 if ( !isset( $update->dismissed ) || !$update->dismissed ) … … 186 194 } 187 195 echo '</ul>'; 188 196 // Don't show the maintenance mode notice when we are only showing a single re-install option. 189 if ( $updates && ( count( $updates ) > 1 || $updates[0]->response != 'latest' ) ) {197 if ( $updates && ( count( $updates ) > 1 || $updates[0]->response != 'latest' ) && current_user_can( 'update_core' ) ) { 190 198 echo '<p>' . __( 'While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.' ) . '</p>'; 191 199 } elseif ( ! $updates ) { 192 200 list( $normalized_version ) = explode( '-', $wp_version ); … … 216 224 $core_update_version = $core_updates[0]->current; 217 225 ?> 218 226 <h3><?php _e( 'Plugins' ); ?></h3> 219 <p><?php _e( 'The following plugins have new versions available. Check the ones you want to update and then click “Update Plugins”.' ); ?></p> 220 <form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-plugins" class="upgrade"> 221 <?php wp_nonce_field('upgrade-core'); ?> 222 <p><input id="upgrade-plugins" class="button" type="submit" value="<?php esc_attr_e('Update Plugins'); ?>" name="upgrade" /></p> 227 <p> 228 <?php _e( 'The following plugins have new versions available.' ); ?> 229 <?php if ( current_user_can( 'update_plugins' ) ) : ?> 230 <?php _e( 'Check the ones you want to update and then click “Update Plugins”.' ); ?> 231 <?php endif; ?> 232 </p> 233 234 <?php if ( current_user_can( 'update_plugins' ) ) : ?> 235 <form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-plugins" class="upgrade"> 236 <?php wp_nonce_field('upgrade-core'); ?> 237 <p><input id="upgrade-plugins" class="button" type="submit" value="<?php esc_attr_e('Update Plugins'); ?>" name="upgrade" /></p> 238 <?php endif; ?> 239 223 240 <table class="widefat" id="update-plugins-table"> 224 <thead> 225 <tr> 226 <th scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all" /></th> 227 <th scope="col" class="manage-column"><label for="plugins-select-all"><?php _e('Select All'); ?></label></th> 228 </tr> 229 </thead> 230 231 <tfoot> 232 <tr> 233 <th scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all-2" /></th> 234 <th scope="col" class="manage-column"><label for="plugins-select-all-2"><?php _e('Select All'); ?></label></th> 235 </tr> 236 </tfoot> 241 <?php if ( current_user_can( 'update_plugins' ) ) : ?> 242 <thead> 243 <tr> 244 <th scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all" /></th> 245 <th scope="col" class="manage-column"><label for="plugins-select-all"><?php _e('Select All'); ?></label></th> 246 </tr> 247 </thead> 248 249 <tfoot> 250 <tr> 251 <th scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all-2" /></th> 252 <th scope="col" class="manage-column"><label for="plugins-select-all-2"><?php _e('Select All'); ?></label></th> 253 </tr> 254 </tfoot> 255 <?php endif; ?> 256 237 257 <tbody class="plugins"> 238 258 <?php 239 259 foreach ( (array) $plugins as $plugin_file => $plugin_data) { … … 267 287 $details_text = sprintf(__('View version %1$s details'), $plugin_data->update->new_version); 268 288 $details = sprintf('<a href="%1$s" class="thickbox" title="%2$s">%3$s</a>.', esc_url($details_url), esc_attr($plugin_data->Name), $details_text); 269 289 270 echo " 271 <tr> 272 <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th> 273 <td><p><strong>{$plugin_data->Name}</strong><br />" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . ' ' . $details . $compat . $upgrade_notice . "</p></td> 274 </tr>"; 290 ?> 291 <tr> 292 <?php if ( current_user_can( 'update_plugins' ) ) : ?> 293 <th scope="row" class="check-column"><input type="checkbox" name="checked[]" value="<?php esc_attr_e( $plugin_file ); ?>" /></th> 294 <?php endif; ?> 295 296 <td> 297 <p> 298 <strong><?php echo $plugin_data->Name; ?></strong><br /> 299 <?php printf( __( 'You have version %s installed.' ), $plugin_data->Version ); ?> 300 301 <?php if ( current_user_can( 'update_plugins' ) ) : ?> 302 <?php printf( __( 'Update to %s.' ), $plugin_data->update->new_version ); ?> 303 <?php else : ?> 304 <?php printf( __( '%s is available.' ), $plugin_data->update->new_version ); ?> 305 <?php endif; ?> 306 307 <?php echo $details . $compat . $upgrade_notice; ?> 308 </p> 309 </td> 310 </tr> 311 <?php 275 312 } 276 313 ?> 277 314 </tbody> 278 315 </table> 279 <p><input id="upgrade-plugins-2" class="button" type="submit" value="<?php esc_attr_e('Update Plugins'); ?>" name="upgrade" /></p> 280 </form> 281 <?php 316 317 <?php if ( current_user_can( 'update_plugins' ) ) : ?> 318 <p><input id="upgrade-plugins-2" class="button" type="submit" value="<?php esc_attr_e('Update Plugins'); ?>" name="upgrade" /></p> 319 </form> 320 <?php endif; 282 321 } 283 322 284 323 function list_theme_updates() { … … 293 332 294 333 ?> 295 334 <h3><?php _e( 'Themes' ); ?></h3> 296 <p><?php _e( 'The following themes have new versions available. Check the ones you want to update and then click “Update Themes”.' ); ?></p> 297 <p><?php printf( __( '<strong>Please Note:</strong> Any customizations you have made to theme files will be lost. Please consider using <a href="%s">child themes</a> for modifications.' ), __( 'http://codex.wordpress.org/Child_Themes' ) ); ?></p> 298 <form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-themes" class="upgrade"> 299 <?php wp_nonce_field('upgrade-core'); ?> 300 <p><input id="upgrade-themes" class="button" type="submit" value="<?php esc_attr_e('Update Themes'); ?>" name="upgrade" /></p> 335 <p> 336 <?php _e( 'The following themes have new versions available.' ); ?> 337 <?php if ( current_user_can( 'update_themes' ) ) : ?> 338 <?php _e( 'Check the ones you want to update and then click “Update Themes”.' ); ?> 339 <?php endif; ?> 340 </p> 341 342 <p><?php printf( __( '<strong>Please Note:</strong> Any customizations you have made to theme files will be lost during an update. Please consider using <a href="%s">child themes</a> for modifications.' ), __( 'http://codex.wordpress.org/Child_Themes' ) ); ?></p> 343 344 <?php if ( current_user_can( 'update_themes' ) ) : ?> 345 <form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-themes" class="upgrade"> 346 <?php wp_nonce_field('upgrade-core'); ?> 347 <p><input id="upgrade-themes" class="button" type="submit" value="<?php esc_attr_e('Update Themes'); ?>" name="upgrade" /></p> 348 <?php endif; ?> 349 301 350 <table class="widefat" id="update-themes-table"> 302 <thead> 303 <tr> 304 <th scope="col" class="manage-column check-column"><input type="checkbox" id="themes-select-all" /></th> 305 <th scope="col" class="manage-column"><label for="themes-select-all"><?php _e('Select All'); ?></label></th> 306 </tr> 307 </thead> 351 <?php if ( current_user_can( 'update_themes' ) ) : ?> 352 <thead> 353 <tr> 354 <th scope="col" class="manage-column check-column"><input type="checkbox" id="themes-select-all" /></th> 355 <th scope="col" class="manage-column"><label for="themes-select-all"><?php _e('Select All'); ?></label></th> 356 </tr> 357 </thead> 358 359 <tfoot> 360 <tr> 361 <th scope="col" class="manage-column check-column"><input type="checkbox" id="themes-select-all-2" /></th> 362 <th scope="col" class="manage-column"><label for="themes-select-all-2"><?php _e('Select All'); ?></label></th> 363 </tr> 364 </tfoot> 365 <?php endif; ?> 308 366 309 <tfoot>310 <tr>311 <th scope="col" class="manage-column check-column"><input type="checkbox" id="themes-select-all-2" /></th>312 <th scope="col" class="manage-column"><label for="themes-select-all-2"><?php _e('Select All'); ?></label></th>313 </tr>314 </tfoot>315 367 <tbody class="plugins"> 316 368 <?php 317 369 foreach ( $themes as $stylesheet => $theme ) { 318 echo " 319 <tr> 320 <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr( $stylesheet ) . "' /></th> 321 <td class='plugin-title'><img src='" . esc_url( $theme->get_screenshot() ) . "' width='85' height='64' style='float:left; padding: 0 5px 5px' /><strong>" . $theme->display('Name') . '</strong> ' . sprintf( __( 'You have version %1$s installed. Update to %2$s.' ), $theme->display('Version'), $theme->update['new_version'] ) . "</td> 322 </tr>"; 370 ?> 371 372 <tr> 373 <th scope="row" class="check-column"><input type="checkbox" name="checked[]" value="<?php esc_attr_e( $stylesheet ); ?>" /></th> 374 <td class="plugin-title"> 375 <img src="<?php echo esc_url( $theme->get_screenshot() ); ?>" width="85" height="64" style="float: left; padding: 0 5px 5px;" /> 376 <strong><?php echo $theme->display('Name'); ?></strong> 377 <?php printf( __( 'You have version %s installed.' ), $theme->display('Version') ); ?> 378 379 <?php if ( current_user_can( 'update_themes' ) ) : ?> 380 <?php printf( __( 'Update to %s.' ), $theme->update['new_version'] ); ?> 381 <?php else : ?> 382 <?php printf( __( '%s is available.' ), $theme->update['new_version'] ); ?> 383 <?php endif; ?> 384 </td> 385 </tr> 386 387 <?php 323 388 } 324 389 ?> 325 390 </tbody> 326 391 </table> 327 <p><input id="upgrade-themes-2" class="button" type="submit" value="<?php esc_attr_e('Update Themes'); ?>" name="upgrade" /></p> 328 </form> 329 <?php 392 393 <?php if ( current_user_can( 'update_themes' ) ) : ?> 394 <p><input id="upgrade-themes-2" class="button" type="submit" value="<?php esc_attr_e('Update Themes'); ?>" name="upgrade" /></p> 395 </form> 396 <?php endif; 330 397 } 331 398 332 399 function list_translation_updates() { … … 512 579 echo ' <a class="button" href="' . esc_url( self_admin_url('update-core.php?force-check=1') ) . '">' . __( 'Check Again' ) . '</a>'; 513 580 echo '</p>'; 514 581 515 if ( $core = current_user_can( ' update_core' ) )582 if ( $core = current_user_can( 'view_core_updates' ) ) 516 583 core_upgrade_preamble(); 517 if ( $plugins = current_user_can( ' update_plugins' ) )584 if ( $plugins = current_user_can( 'view_plugin_updates' ) ) 518 585 list_plugin_updates(); 519 if ( $themes = current_user_can( ' update_themes' ) )586 if ( $themes = current_user_can( 'view_theme_updates' ) ) 520 587 list_theme_updates(); 521 588 if ( $core || $plugins || $themes ) 522 589 list_translation_updates(); … … 532 599 533 600 } elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) { 534 601 535 if ( ! current_user_can( ' update_core' ) )536 wp_die( __( 'You do not have sufficient permissions to updatethis site.' ) );602 if ( ! current_user_can( 'view_core_updates' ) ) 603 wp_die( __( 'You do not have sufficient permissions to view updates for this site.' ) ); 537 604 538 605 check_admin_referer('upgrade-core'); 539 606 … … 557 624 558 625 } elseif ( 'do-plugin-upgrade' == $action ) { 559 626 560 if ( ! current_user_can( ' update_plugins' ) )561 wp_die( __( 'You do not have sufficient permissions to updatethis site.' ) );627 if ( ! current_user_can( 'view_plugin_updates' ) ) 628 wp_die( __( 'You do not have sufficient permissions to view updates for this site.' ) ); 562 629 563 630 check_admin_referer('upgrade-core'); 564 631 … … 585 652 586 653 } elseif ( 'do-theme-upgrade' == $action ) { 587 654 588 if ( ! current_user_can( ' update_themes' ) )589 wp_die( __( 'You do not have sufficient permissions to updatethis site.' ) );655 if ( ! current_user_can( 'view_theme_updates' ) ) 656 wp_die( __( 'You do not have sufficient permissions to view updates for this site.' ) ); 590 657 591 658 check_admin_referer('upgrade-core'); 592 659 -
src/wp-includes/capabilities.php
1274 1274 else 1275 1275 $caps[] = $cap; 1276 1276 break; 1277 case 'view_plugin_updates': 1278 case 'view_theme_updates': 1279 case 'view_core_updates': 1280 if ( is_multisite() && ! is_super_admin( $user_id ) ) 1281 $caps[] = 'do_not_allow'; 1282 else 1283 $caps[] = 'manage_options'; 1284 break; 1277 1285 case 'activate_plugins': 1278 1286 $caps[] = $cap; 1279 1287 if ( is_multisite() ) { -
src/wp-includes/update.php
470 470 function wp_get_update_data() { 471 471 $counts = array( 'plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0 ); 472 472 473 if ( $plugins = current_user_can( ' update_plugins' ) ) {473 if ( $plugins = current_user_can( 'view_plugin_updates' ) ) { 474 474 $update_plugins = get_site_transient( 'update_plugins' ); 475 475 if ( ! empty( $update_plugins->response ) ) 476 476 $counts['plugins'] = count( $update_plugins->response ); 477 477 } 478 478 479 if ( $themes = current_user_can( ' update_themes' ) ) {479 if ( $themes = current_user_can( 'view_theme_updates' ) ) { 480 480 $update_themes = get_site_transient( 'update_themes' ); 481 481 if ( ! empty( $update_themes->response ) ) 482 482 $counts['themes'] = count( $update_themes->response ); 483 483 } 484 484 485 if ( ( $core = current_user_can( ' update_core' ) ) && function_exists( 'get_core_updates' ) ) {485 if ( ( $core = current_user_can( 'view_core_updates' ) ) && function_exists( 'get_core_updates' ) ) { 486 486 $update_wordpress = get_core_updates( array('dismissed' => false) ); 487 if ( ! empty( $update_wordpress ) && ! in_array( $update_wordpress[0]->response, array( 'development', 'latest') ) && current_user_can('update_core') )487 if ( ! empty( $update_wordpress ) && ! in_array( $update_wordpress[0]->response, array( 'development', 'latest' ) ) && current_user_can( 'view_core_updates' ) ) 488 488 $counts['wordpress'] = 1; 489 489 } 490 490