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.


git-svn-id: https://develop.svn.wordpress.org/trunk@25823 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2013-10-17 00:54:15 +00:00
parent d0bd68cf5f
commit c39143fd2e
4 changed files with 53 additions and 61 deletions

View File

@@ -77,11 +77,12 @@ function find_core_auto_update() {
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
$auto_update = false;
$upgrader = new WP_Automatic_Upgrader;
foreach ( $updates->updates as $update ) {
if ( 'autoupdate' != $update->response )
continue;
if ( ! WP_Automatic_Upgrader::should_auto_update( 'core', $update, ABSPATH ) )
if ( ! $upgrader->should_upgrade( 'core', $update, ABSPATH ) )
continue;
if ( ! $auto_update || version_compare( $update->current, $auto_update->current, '>' ) )