WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/17/2013 12:54:15 AM (6 years ago)
Author:
nacin
Message:

Make WP_Automatic_Upgrader a proper object that gets instantiated. Renames nearly all of its methods.

Also renames wp_auto_updates_maybe_update() to wp_maybe_auto_update().

see #22704.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/update-core.php

    r25820 r25823  
    149149        if ( wp_http_supports( 'ssl' ) ) {
    150150            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
     151            $upgrader = new WP_Automatic_Upgrader;
    151152            $future_minor_update = (object) array(
    152153                'current'       => $wp_version . '.1-update-core.php',
     
    155156                'mysql_version' => $required_mysql_version,
    156157            );
    157             $should_auto_update = WP_Automatic_Upgrader::should_auto_update( 'core', $future_minor_update, ABSPATH );
     158            $should_auto_update = $upgrader->should_upgrade( 'core', $future_minor_update, ABSPATH );
    158159            if ( $should_auto_update )
    159160                echo ' ' . __( 'Future security updates will be applied automatically.' );
     
    172173    if ( isset( $updates[0] ) && $updates[0]->response == 'development' ) {
    173174        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    174         if ( wp_http_supports( 'ssl' ) && WP_Automatic_Upgrader::should_auto_update( 'core', $updates[0], ABSPATH ) )
     175        $upgrader = new WP_Automatic_Upgrader;
     176        if ( wp_http_supports( 'ssl' ) && $upgrader->should_upgrade( 'core', $updates[0], ABSPATH ) )
    175177            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>';
    176178    }
Note: See TracChangeset for help on using the changeset viewer.