WordPress.org

Make WordPress Core

Ticket #25998: 25998.diff

File 25998.diff, 3.5 KB (added by kpdesign, 7 years ago)

Second pass

  • src/wp-admin/includes/update-core.php

     
    685685        @set_time_limit( 300 );
    686686
    687687        // Sanity check the unzipped distribution
    688         apply_filters( 'update_feedback', __('Verifying the unpacked files…') );
     688        /**
     689         * Filter the feedback message displayed during the core update process.
     690         *
     691         * The filter is first evaluated after the zip file for the latest version
     692         * has been downloaded and unzipped. It is evaluated five more times during
     693         * the process: before WordPress begins the core upgrade process, before
     694         * Maintenance Mode is enabled, before WordPress begins copying over the
     695         * necessary files, before Maintenance Mode is disabled, and before the
     696         * database is upgraded.
     697         *
     698         * @since 2.5.0
     699         *
     700         * @param string $feedback The core update feedback messages.
     701         */
     702        apply_filters( 'update_feedback', __( 'Verifying the unpacked files…' ) );
    689703        $distro = '';
    690704        $roots = array( '/wordpress/', '/wordpress-mu/' );
    691705        foreach ( $roots as $root ) {
     
    731745        elseif ( !$mysql_compat )
    732746                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 ) );
    733747
     748        /** This filter is documented in wp-admin/includes/update-core.php */
    734749        apply_filters( 'update_feedback', __( 'Preparing to install the latest version…' ) );
    735750
    736751        // Don't copy wp-content, we'll deal with that below
     
    781796                }
    782797        }
    783798
     799        /** This filter is documented in wp-admin/includes/update-core.php */
    784800        apply_filters( 'update_feedback', __( 'Enabling Maintenance mode…' ) );
    785801        // Create maintenance file to signal that we are upgrading
    786802        $maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
     
    788804        $wp_filesystem->delete($maintenance_file);
    789805        $wp_filesystem->put_contents($maintenance_file, $maintenance_string, FS_CHMOD_FILE);
    790806
     807        /** This filter is documented in wp-admin/includes/update-core.php */
    791808        apply_filters( 'update_feedback', __( 'Copying the required files&#8230;' ) );
    792809        // Copy new versions of WP files into place.
    793810        $result = _copy_dir( $from . $distro, $to, $skip );
     
    853870                }
    854871        }
    855872
     873        /** This filter is documented in wp-admin/includes/update-core.php */
    856874        apply_filters( 'update_feedback', __( 'Disabling Maintenance mode&#8230;' ) );
    857875        // Remove maintenance file, we're done with potential site-breaking changes
    858876        $wp_filesystem->delete( $maintenance_file );
     
    924942        }
    925943
    926944        // Upgrade DB with separate request
    927         apply_filters('update_feedback', __('Upgrading database&#8230;'));
     945        /** This filter is documented in wp-admin/includes/update-core.php */
     946        apply_filters( 'update_feedback', __( 'Upgrading database&#8230;' ) );
    928947        $db_upgrade_url = admin_url('upgrade.php?step=upgrade_db');
    929948        wp_remote_post($db_upgrade_url, array('timeout' => 60));
    930949
     
    943962                delete_option('update_core');
    944963
    945964        // If we made it this far:
     965        /**
     966         * Fires after WordPress core has been updated successfully.
     967         *
     968         * @since 3.3.0
     969         *
     970         * @param string $wp_version The current WordPress version.
     971         */
    946972        do_action( '_core_updated_successfully', $wp_version );
    947973
    948974        // Clear the option that blocks auto updates after failures, now that we've been successful.