Make WordPress Core


Ignore:
Timestamp:
02/17/2009 12:13:25 AM (17 years ago)
Author:
ryan
Message:

Check for new version when visiting Tools->Upgrade. fixes #9108

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/update.php

    r10515 r10583  
    3232
    3333    $locale = get_locale();
    34     if (
    35         isset( $current->last_checked ) &&
    36         43200 > ( time() - $current->last_checked ) &&
    37         $current->version_checked == $wp_version
    38     )
    39         return false;
    4034
    4135    // Update last_checked for current to prevent multiple blocking requests if request hangs
     
    8781    set_transient( 'update_core',  $updates);
    8882}
    89 add_action( 'init', 'wp_version_check' );
    9083
    9184/**
     
    244237}
    245238
     239function _maybe_update_core() {
     240    global $wp_version;
     241
     242    $current = get_transient( 'update_core' );
     243
     244    if ( isset( $current->last_checked ) &&
     245        43200 > ( time() - $current->last_checked ) &&
     246        $current->version_checked == $wp_version )
     247        return;
     248
     249    wp_version_check();
     250}
    246251/**
    247252 * Check the last time plugins were run before checking plugin versions.
     
    278283}
    279284
     285add_action( 'init', '_maybe_update_core' );
     286
    280287add_action( 'load-plugins.php', 'wp_update_plugins' );
    281288add_action( 'load-update.php', 'wp_update_plugins' );
Note: See TracChangeset for help on using the changeset viewer.