In automatic background updates, standardize on 'update'.

New, final filter names:
 * auto_update_{$type} (plugin, theme, core, language)
 * automatic_updates_is_vcs_checkout
 * automatic_updates_disabled

New class name is WP_Automatic_Updater. Method names include update() and should_update().

see #22704.


git-svn-id: https://develop.svn.wordpress.org/trunk@25835 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2013-10-17 23:20:56 +00:00
parent ba10ec2cba
commit 8cb344e237
5 changed files with 47 additions and 56 deletions

View File

@@ -148,14 +148,14 @@ function core_upgrade_preamble() {
if ( wp_http_supports( 'ssl' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
$upgrader = new WP_Automatic_Upgrader;
$upgrader = new WP_Automatic_Updater;
$future_minor_update = (object) array(
'current' => $wp_version . '.1-update-core.php',
'version' => $wp_version . '.1-update-core.php',
'php_version' => $required_php_version,
'mysql_version' => $required_mysql_version,
);
$should_auto_update = $upgrader->should_upgrade( 'core', $future_minor_update, ABSPATH );
$should_auto_update = $upgrader->should_update( 'core', $future_minor_update, ABSPATH );
if ( $should_auto_update )
echo ' ' . __( 'Future security updates will be applied automatically.' );
}
@@ -172,8 +172,8 @@ function core_upgrade_preamble() {
if ( isset( $updates[0] ) && $updates[0]->response == 'development' ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
$upgrader = new WP_Automatic_Upgrader;
if ( wp_http_supports( 'ssl' ) && $upgrader->should_upgrade( 'core', $updates[0], ABSPATH ) )
$upgrader = new WP_Automatic_Updater;
if ( wp_http_supports( 'ssl' ) && $upgrader->should_update( 'core', $updates[0], ABSPATH ) )
echo '<div class="updated inline"><p><strong>BETA TESTERS:</strong> This site is set up to install updates of future beta versions automatically.</p></div>';
}