]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/update-core.php
WordPress 3.9-scripts
[autoinstalls/wordpress.git] / wp-admin / update-core.php
index 3a17482c56d8fc3c8cbec9b99e9d2ccd20603c3f..a8a7aa9909fe57b57b6fd8814345fc34cd70bc33 100644 (file)
@@ -11,6 +11,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
 
 wp_enqueue_style( 'plugin-install' );
 wp_enqueue_script( 'plugin-install' );
 
 wp_enqueue_style( 'plugin-install' );
 wp_enqueue_script( 'plugin-install' );
+wp_enqueue_script( 'updates' );
 add_thickbox();
 
 if ( is_multisite() && ! is_network_admin() ) {
 add_thickbox();
 
 if ( is_multisite() && ! is_network_admin() ) {
@@ -133,7 +134,7 @@ function dismissed_updates() {
 /**
  * Display upgrade WordPress for downloading latest or upgrading automatically form.
  *
 /**
  * Display upgrade WordPress for downloading latest or upgrading automatically form.
  *
- * @since 2.7
+ * @since 2.7.0
  *
  * @return null
  */
  *
  * @return null
  */
@@ -220,7 +221,7 @@ function list_plugin_updates() {
 <form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-plugins" class="upgrade">
 <?php wp_nonce_field('upgrade-core'); ?>
 <p><input id="upgrade-plugins" class="button" type="submit" value="<?php esc_attr_e('Update Plugins'); ?>" name="upgrade" /></p>
 <form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-plugins" class="upgrade">
 <?php wp_nonce_field('upgrade-core'); ?>
 <p><input id="upgrade-plugins" class="button" type="submit" value="<?php esc_attr_e('Update Plugins'); ?>" name="upgrade" /></p>
-<table class="widefat" cellspacing="0" id="update-plugins-table">
+<table class="widefat" id="update-plugins-table">
        <thead>
        <tr>
                <th scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all" /></th>
        <thead>
        <tr>
                <th scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all" /></th>
@@ -268,7 +269,7 @@ function list_plugin_updates() {
                $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);
 
                echo "
                $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);
 
                echo "
-       <tr class='active'>
+       <tr>
                <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th>
                <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>
        </tr>";
                <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th>
                <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>
        </tr>";
@@ -298,7 +299,7 @@ function list_theme_updates() {
 <form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-themes" class="upgrade">
 <?php wp_nonce_field('upgrade-core'); ?>
 <p><input id="upgrade-themes" class="button" type="submit" value="<?php esc_attr_e('Update Themes'); ?>" name="upgrade" /></p>
 <form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-themes" class="upgrade">
 <?php wp_nonce_field('upgrade-core'); ?>
 <p><input id="upgrade-themes" class="button" type="submit" value="<?php esc_attr_e('Update Themes'); ?>" name="upgrade" /></p>
-<table class="widefat" cellspacing="0" id="update-themes-table">
+<table class="widefat" id="update-themes-table">
        <thead>
        <tr>
                <th scope="col" class="manage-column check-column"><input type="checkbox" id="themes-select-all" /></th>
        <thead>
        <tr>
                <th scope="col" class="manage-column check-column"><input type="checkbox" id="themes-select-all" /></th>
@@ -316,7 +317,7 @@ function list_theme_updates() {
 <?php
        foreach ( $themes as $stylesheet => $theme ) {
                echo "
 <?php
        foreach ( $themes as $stylesheet => $theme ) {
                echo "
-       <tr class='active'>
+       <tr>
                <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr( $stylesheet ) . "' /></th>
                <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>
        </tr>";
                <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr( $stylesheet ) . "' /></th>
                <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>
        </tr>";
@@ -353,7 +354,7 @@ function list_translation_updates() {
 /**
  * Upgrade WordPress core display.
  *
 /**
  * Upgrade WordPress core display.
  *
- * @since 2.7
+ * @since 2.7.0
  *
  * @return null
  */
  *
  * @return null
  */
@@ -376,7 +377,6 @@ function do_core_upgrade( $reinstall = false ) {
 
 ?>
        <div class="wrap">
 
 ?>
        <div class="wrap">
-       <?php screen_icon('tools'); ?>
        <h2><?php _e('Update WordPress'); ?></h2>
 <?php
 
        <h2><?php _e('Update WordPress'); ?></h2>
 <?php
 
@@ -448,10 +448,6 @@ function do_undismiss_core_update() {
        exit;
 }
 
        exit;
 }
 
-function no_update_actions($actions) {
-       return '';
-}
-
 $action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core';
 
 $upgrade_error = false;
 $action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core';
 
 $upgrade_error = false;
@@ -462,37 +458,44 @@ if ( ( 'do-theme-upgrade' == $action || ( 'do-plugin-upgrade' == $action && ! is
 }
 
 $title = __('WordPress Updates');
 }
 
 $title = __('WordPress Updates');
-$parent_file = 'tools.php';
+$parent_file = 'index.php';
+
+$updates_overview  = '<p>' . __( 'On this screen, you can update to the latest version of WordPress, as well as update your themes and plugins from the WordPress.org repositories.' ) . '</p>';
+$updates_overview .= '<p>' . __( 'If an update is available, you&#8127;ll see a notification appear in the Toolbar and navigation menu.' ) . ' ' . __( 'Keeping your site updated is important for security. It also makes the internet a safer place for you and your readers.' ) . '</p>';
 
 get_current_screen()->add_help_tab( array(
 
 get_current_screen()->add_help_tab( array(
-'id'           => 'overview',
-'title'                => __('Overview'),
-'content'      =>
-       '<p>' . __('This screen lets you update to the latest version of WordPress as well as update your themes and plugins from the WordPress.org repository. When updates are available, the number of available updates will appear in a bubble on the left hand menu as a notification.') . '</p>' .
-       '<p>' . __('It is very important to keep your WordPress installation up to date for security reasons, so when you see a number appear, make sure you take the time to update, which is an easy process.') . '</p>'
+       'id'      => 'overview',
+       'title'   => __( 'Overview' ),
+       'content' => $updates_overview
 ) );
 
 ) );
 
+$updates_howto  = '<p>' . __( '<strong>WordPress</strong> &mdash; Updating your WordPress installation is a simple one-click procedure: just <strong>click on the &#8220;Update Now&#8221; button</strong> when you are notified that a new version is available.' ) . ' ' . __( 'In most cases, WordPress will automatically apply maintenance and security updates in the background for you.' ) . '</p>';
+$updates_howto .= '<p>' . __( '<strong>Themes and Plugins</strong> &mdash; To update individual themes or plugins from this screen, use the checkboxes to make your selection, then <strong>click on the appropriate &#8220;Update&#8221; button</strong>. To update all of your themes or plugins at once, you can check the box at the top of the section to select all before clicking the update button.' ) . '</p>';
+
+if ( 'en_US' != get_locale() ) {
+       $updates_howto .= '<p>' . __( '<strong>Translations</strong> &mdash; The files translating WordPress into your language are updated for you whenever any other updates occur. But if these files are out of date, you can <strong>click the &#8220;Update Translations&#8221;</strong> button.' ) . '</p>';
+}
+
 get_current_screen()->add_help_tab( array(
 get_current_screen()->add_help_tab( array(
-'id'           => 'how-to-update',
-'title'                => __('How to Update'),
-'content'      =>
-       '<p>' . __('Updating your WordPress installation is a simple one-click procedure; just click on the Update button when it says a new version is available.') . '</p>' .
-       '<p>' . __('To update themes or plugins from this screen, use the checkboxes to make your selection and click on the appropriate Update button. Check the box at the top of the Themes or Plugins section to select all and update them all at once.') . '</p>'
+       'id'      => 'how-to-update',
+       'title'   => __( 'How to Update' ),
+       'content' => $updates_howto
 ) );
 
 get_current_screen()->set_help_sidebar(
        '<p><strong>' . __('For more information:') . '</strong></p>' .
 ) );
 
 get_current_screen()->set_help_sidebar(
        '<p><strong>' . __('For more information:') . '</strong></p>' .
-       '<p>' . __('<a href="http://codex.wordpress.org/Dashboard_Updates_Screen" target="_blank">Documentation on Updating WordPress</a>') . '</p>' .
-       '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+       '<p>' . __( '<a href="http://codex.wordpress.org/Dashboard_Updates_Screen" target="_blank">Documentation on Updating WordPress</a>' ) . '</p>' .
+       '<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
 );
 
 if ( 'upgrade-core' == $action ) {
 );
 
 if ( 'upgrade-core' == $action ) {
+       // Force a update check when requested
+       $force_check = ! empty( $_GET['force-check'] );
+       wp_version_check( array(), $force_check );
 
 
-       wp_version_check();
        require_once(ABSPATH . 'wp-admin/admin-header.php');
        ?>
        <div class="wrap">
        require_once(ABSPATH . 'wp-admin/admin-header.php');
        ?>
        <div class="wrap">
-       <?php screen_icon('tools'); ?>
        <h2><?php _e('WordPress Updates'); ?></h2>
        <?php
        if ( $upgrade_error ) {
        <h2><?php _e('WordPress Updates'); ?></h2>
        <?php
        if ( $upgrade_error ) {
@@ -507,7 +510,7 @@ if ( 'upgrade-core' == $action ) {
        echo '<p>';
        /* translators: %1 date, %2 time. */
        printf( __('Last checked on %1$s at %2$s.'), date_i18n( get_option( 'date_format' ) ), date_i18n( get_option( 'time_format' ) ) );
        echo '<p>';
        /* translators: %1 date, %2 time. */
        printf( __('Last checked on %1$s at %2$s.'), date_i18n( get_option( 'date_format' ) ), date_i18n( get_option( 'time_format' ) ) );
-       echo ' &nbsp; <a class="button" href="' . esc_url( self_admin_url('update-core.php') ) . '">' . __( 'Check Again' ) . '</a>';
+       echo ' &nbsp; <a class="button" href="' . esc_url( self_admin_url('update-core.php?force-check=1') ) . '">' . __( 'Check Again' ) . '</a>';
        echo '</p>';
 
        if ( $core = current_user_can( 'update_core' ) )
        echo '</p>';
 
        if ( $core = current_user_can( 'update_core' ) )
@@ -519,7 +522,12 @@ if ( 'upgrade-core' == $action ) {
        if ( $core || $plugins || $themes )
                list_translation_updates();
        unset( $core, $plugins, $themes );
        if ( $core || $plugins || $themes )
                list_translation_updates();
        unset( $core, $plugins, $themes );
-       do_action('core_upgrade_preamble');
+       /**
+        * Fires after the core, plugin, and theme update tables.
+        *
+        * @since 2.9.0
+        */
+       do_action( 'core_upgrade_preamble' );
        echo '</div>';
        include(ABSPATH . 'wp-admin/admin-footer.php');
 
        echo '</div>';
        include(ABSPATH . 'wp-admin/admin-footer.php');
 
@@ -571,7 +579,6 @@ if ( 'upgrade-core' == $action ) {
 
        require_once(ABSPATH . 'wp-admin/admin-header.php');
        echo '<div class="wrap">';
 
        require_once(ABSPATH . 'wp-admin/admin-header.php');
        echo '<div class="wrap">';
-       screen_icon('plugins');
        echo '<h2>' . esc_html__('Update Plugins') . '</h2>';
        echo "<iframe src='$url' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>";
        echo '</div>';
        echo '<h2>' . esc_html__('Update Plugins') . '</h2>';
        echo "<iframe src='$url' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>";
        echo '</div>';
@@ -600,7 +607,6 @@ if ( 'upgrade-core' == $action ) {
 
        require_once(ABSPATH . 'wp-admin/admin-header.php');
        echo '<div class="wrap">';
 
        require_once(ABSPATH . 'wp-admin/admin-header.php');
        echo '<div class="wrap">';
-       screen_icon('themes');
        echo '<h2>' . esc_html__('Update Themes') . '</h2>';
        echo "<iframe src='$url' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>";
        echo '</div>';
        echo '<h2>' . esc_html__('Update Themes') . '</h2>';
        echo "<iframe src='$url' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>";
        echo '</div>';
@@ -627,5 +633,14 @@ if ( 'upgrade-core' == $action ) {
        require_once( ABSPATH . 'wp-admin/admin-footer.php' );
 
 } else {
        require_once( ABSPATH . 'wp-admin/admin-footer.php' );
 
 } else {
-       do_action('update-core-custom_' . $action);
+       /**
+        * Fires for each custom update action on the WordPress Updates screen.
+        *
+        * The dynamic portion of the hook name, $action, refers to the
+        * passed update action. The hook fires in lieu of all available
+        * default update actions.
+        *
+        * @since 3.2.0
+        */
+       do_action( "update-core-custom_{$action}" );
 }
 }