Changeset 25806 for trunk/src/wp-admin/update-core.php
- Timestamp:
- 10/16/2013 04:14:29 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/update-core.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/update-core.php
r25784 r25806 325 325 } 326 326 327 function list_translation_updates() { 328 $updates = wp_get_translation_updates(); 329 if ( ! $updates ) { 330 if ( 'en_US' != get_locale() ) { 331 echo '<h3>' . __( 'Translations' ) . '</h3>'; 332 echo '<p>' . __( 'Your translations are all up to date.' ) . '</p>'; 333 } 334 return; 335 } 336 337 $form_action = 'update-core.php?action=do-translation-upgrade'; 338 ?> 339 <h3><?php _e( 'Translations' ); ?></h3> 340 <form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-themes" class="upgrade"> 341 <p><?php _e( 'Some of your translations are out of date.' ); ?></p> 342 <?php wp_nonce_field('upgrade-translations'); ?> 343 <p><input class="button" type="submit" value="<?php esc_attr_e( 'Update Translations' ); ?>" name="upgrade" /></p> 344 </form> 345 <?php 346 } 347 327 348 /** 328 349 * Upgrade WordPress core display. … … 342 363 $url = 'update-core.php?action=do-core-upgrade'; 343 364 $url = wp_nonce_url($url, 'upgrade-core'); 344 if ( false === ($credentials = request_filesystem_credentials($url, '', false, ABSPATH)) )345 return;346 365 347 366 $version = isset( $_POST['version'] )? $_POST['version'] : false; … … 351 370 return; 352 371 353 if ( ! WP_Filesystem($credentials, ABSPATH) ) {354 request_filesystem_credentials($url, '', true, ABSPATH); //Failed to connect, Error and request again355 return;356 }357 372 ?> 358 373 <div class="wrap"> … … 360 375 <h2><?php _e('Update WordPress'); ?></h2> 361 376 <?php 377 378 if ( false === ( $credentials = request_filesystem_credentials( $url, '', false, ABSPATH ) ) ) { 379 echo '</div>'; 380 return; 381 } 382 383 if ( ! WP_Filesystem( $credentials, ABSPATH ) ) { 384 // Failed to connect, Error and request again 385 request_filesystem_credentials( $url, '', true, ABSPATH ); 386 echo '</div>'; 387 return; 388 } 389 362 390 if ( $wp_filesystem->errors->get_error_code() ) { 363 391 foreach ( $wp_filesystem->errors->get_error_messages() as $message ) … … 478 506 echo '</p>'; 479 507 480 if ( current_user_can( 'update_core' ) )508 if ( $core = current_user_can( 'update_core' ) ) 481 509 core_upgrade_preamble(); 482 if ( current_user_can( 'update_plugins' ) )510 if ( $plugins = current_user_can( 'update_plugins' ) ) 483 511 list_plugin_updates(); 484 if ( current_user_can( 'update_themes' ) )512 if ( $themes = current_user_can( 'update_themes' ) ) 485 513 list_theme_updates(); 514 if ( $core || $plugins || $themes ) 515 list_translation_updates(); 516 unset( $core, $plugins, $themes ); 486 517 do_action('core_upgrade_preamble'); 487 518 echo '</div>'; … … 571 602 include(ABSPATH . 'wp-admin/admin-footer.php'); 572 603 604 } elseif ( 'do-translation-upgrade' == $action ) { 605 606 if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_plugins' ) && ! current_user_can( 'update_themes' ) ) 607 wp_die( __( 'You do not have sufficient permissions to update this site.' ) ); 608 609 check_admin_referer( 'upgrade-translations' ); 610 611 require_once( ABSPATH . 'wp-admin/admin-header.php' ); 612 include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); 613 614 $url = 'update-core.php?action=do-translation-upgrade'; 615 $nonce = 'upgrade-translations'; 616 $title = __( 'Update Translations' ); 617 $context = WP_LANG_DIR; 618 619 $upgrader = new Language_Pack_Upgrader( new Language_Pack_Upgrader_Skin( compact( 'url', 'nonce', 'title', 'context' ) ) ); 620 $result = $upgrader->bulk_upgrade(); 621 622 require_once( ABSPATH . 'wp-admin/admin-footer.php' ); 623 573 624 } else { 574 625 do_action('update-core-custom_' . $action);
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)