Make WordPress Core

Ticket #25998: 25998.2.diff

File 25998.2.diff, 4.2 KB (added by DrewAPicture, 11 years ago)

3rd pass

  • src/wp-admin/includes/class-wp-upgrader.php

     
    14011401                        }
    14021402
    14031403                        if ( $try_rollback ) {
     1404                                /** This filter is documented in wp-admin/includes/update-core.php */
    14041405                                apply_filters( 'update_feedback', $result );
     1406                                /** This filter is documented in wp-admin/includes/update-core.php */
    14051407                                apply_filters( 'update_feedback', $this->strings['start_rollback'] );
    14061408
    14071409                                $rollback_result = $this->upgrade( $current, array_merge( $parsed_args, array( 'do_rollback' => true ) ) );
  • src/wp-admin/includes/update-core.php

     
    684684
    685685        @set_time_limit( 300 );
    686686
    687         // Sanity check the unzipped distribution
    688         apply_filters( 'update_feedback', __('Verifying the unpacked files…') );
     687        /**
     688         * Filter the feedback message displayed during the core update process.
     689         *
     690         * The filter is first evaluated after the zip file for the latest version
     691         * has been downloaded and unzipped. It is evaluated five more times during
     692         * the process:
     693         * 1. Before WordPress begins the core upgrade process.
     694         * 2. Before Maintenance Mode is enabled.
     695         * 3. Before WordPress begins copying over the necessary files.
     696         * 4. Before Maintenance Mode is disabled.
     697         * 5. Before the database is upgraded.
     698         *
     699         * @since 2.5.0
     700         *
     701         * @param string $feedback The core update feedback messages.
     702         */
     703        apply_filters( 'update_feedback', __( 'Verifying the unpacked files…' ) );
     704
     705        // Sanity check the unzipped distribution.
    689706        $distro = '';
    690707        $roots = array( '/wordpress/', '/wordpress-mu/' );
    691708        foreach ( $roots as $root ) {
     
    731748        elseif ( !$mysql_compat )
    732749                return new WP_Error( 'mysql_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ) );
    733750
     751        /** This filter is documented in wp-admin/includes/update-core.php */
    734752        apply_filters( 'update_feedback', __( 'Preparing to install the latest version…' ) );
    735753
    736754        // Don't copy wp-content, we'll deal with that below
     
    781799                }
    782800        }
    783801
     802        /** This filter is documented in wp-admin/includes/update-core.php */
    784803        apply_filters( 'update_feedback', __( 'Enabling Maintenance mode…' ) );
    785804        // Create maintenance file to signal that we are upgrading
    786805        $maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
     
    788807        $wp_filesystem->delete($maintenance_file);
    789808        $wp_filesystem->put_contents($maintenance_file, $maintenance_string, FS_CHMOD_FILE);
    790809
     810        /** This filter is documented in wp-admin/includes/update-core.php */
    791811        apply_filters( 'update_feedback', __( 'Copying the required files&#8230;' ) );
    792812        // Copy new versions of WP files into place.
    793813        $result = _copy_dir( $from . $distro, $to, $skip );
     
    853873                }
    854874        }
    855875
     876        /** This filter is documented in wp-admin/includes/update-core.php */
    856877        apply_filters( 'update_feedback', __( 'Disabling Maintenance mode&#8230;' ) );
    857878        // Remove maintenance file, we're done with potential site-breaking changes
    858879        $wp_filesystem->delete( $maintenance_file );
     
    924945        }
    925946
    926947        // Upgrade DB with separate request
    927         apply_filters('update_feedback', __('Upgrading database&#8230;'));
     948        /** This filter is documented in wp-admin/includes/update-core.php */
     949        apply_filters( 'update_feedback', __( 'Upgrading database&#8230;' ) );
    928950        $db_upgrade_url = admin_url('upgrade.php?step=upgrade_db');
    929951        wp_remote_post($db_upgrade_url, array('timeout' => 60));
    930952
     
    942964        else
    943965                delete_option('update_core');
    944966
    945         // If we made it this far:
     967        /**
     968         * Fires after WordPress core has been successfully updated.
     969         *
     970         * @since 3.3.0
     971         *
     972         * @param string $wp_version The current WordPress version.
     973         */
    946974        do_action( '_core_updated_successfully', $wp_version );
    947975
    948976        // Clear the option that blocks auto updates after failures, now that we've been successful.