Make WordPress Core


Ignore:
Timestamp:
10/17/2013 12:54:15 AM (11 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-includes/update.php

    r25810 r25823  
    407407
    408408/**
    409  * Cron entry which runs the WordPress Automatic Updates
     409 * Performs WordPress automatic background updates.
    410410 *
    411411 * @since 3.7.0
    412412 */
    413 function wp_auto_updates_maybe_update() {
     413function wp_maybe_auto_update() {
    414414    include_once ABSPATH . '/wp-admin/includes/admin.php';
    415415    include_once ABSPATH . '/wp-admin/includes/class-wp-upgrader.php';
    416416
    417     if ( WP_Automatic_Upgrader::upgrader_disabled() )
     417    $upgrader = new WP_Automatic_Upgrader;
     418    if ( $upgrader->is_disabled() )
    418419        return;
    419420
    420     WP_Automatic_Upgrader::perform_auto_updates();
     421    $upgrader->run();
    421422}
    422423
     
    566567        wp_schedule_event(time(), 'twicedaily', 'wp_update_themes');
    567568
    568     if ( !wp_next_scheduled( 'wp_auto_updates_maybe_update' ) && ! defined( 'WP_INSTALLING' ) )
    569         wp_schedule_event( time(), 'twicedaily', 'wp_auto_updates_maybe_update' );
    570 
     569    if ( !wp_next_scheduled( 'wp_maybe_auto_update' ) && ! defined( 'WP_INSTALLING' ) )
     570        wp_schedule_event( time(), 'twicedaily', 'wp_maybe_auto_update' );
    571571}
    572572
     
    592592add_action( 'upgrader_process_complete', 'wp_update_themes' );
    593593
    594 // Automatic Updates - Cron callback
    595 add_action( 'wp_auto_updates_maybe_update', 'wp_auto_updates_maybe_update' );
     594add_action( 'wp_maybe_auto_update', 'wp_maybe_auto_update' );
    596595
    597596add_action('init', 'wp_schedule_update_checks');
Note: See TracChangeset for help on using the changeset viewer.