Make WordPress Core


Ignore:
Timestamp:
01/08/2010 08:49:55 PM (15 years ago)
Author:
ryan
Message:

Convert update_themes, update_plugins, update_core, and dismissed_update_core into site transients/plugins. Remove no longer need compat code.

File:
1 edited

Legend:

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

    r12523 r12673  
    2727    $php_version = phpversion();
    2828
    29     $current = get_transient( 'update_core' );
     29    $current = get_site_transient( 'update_core' );
    3030    if ( ! is_object($current) ) {
    3131        $current = new stdClass;
     
    3838    // Update last_checked for current to prevent multiple blocking requests if request hangs
    3939    $current->last_checked = time();
    40     set_transient( 'update_core', $current );
     40    set_site_transient( 'update_core', $current );
    4141
    4242    if ( method_exists( $wpdb, 'db_version' ) )
     
    8686    $updates->last_checked = time();
    8787    $updates->version_checked = $wp_version;
    88     set_transient( 'update_core',  $updates);
     88    set_site_transient( 'update_core',  $updates);
    8989}
    9090
     
    114114    $plugins = get_plugins();
    115115    $active  = get_option( 'active_plugins' );
    116     $current = get_transient( 'update_plugins' );
     116    $current = get_site_transient( 'update_plugins' );
    117117    if ( ! is_object($current) )
    118118        $current = new stdClass;
     
    146146    // Update last_checked for current to prevent multiple blocking requests if request hangs
    147147    $current->last_checked = time();
    148     set_transient( 'update_plugins', $current );
     148    set_site_transient( 'update_plugins', $current );
    149149
    150150    $to_send = (object)compact('plugins', 'active');
     
    171171        $new_option->response = array();
    172172
    173     set_transient( 'update_plugins', $new_option );
     173    set_site_transient( 'update_plugins', $new_option );
    174174}
    175175
     
    197197
    198198    $installed_themes = get_themes( );
    199     $current_theme = get_transient( 'update_themes' );
     199    $current_theme = get_site_transient( 'update_themes' );
    200200    if ( ! is_object($current_theme) )
    201201        $current_theme = new stdClass;
     
    240240    // Update last_checked for current to prevent multiple blocking requests if request hangs
    241241    $current_theme->last_checked = time();
    242     set_transient( 'update_themes', $current_theme );
     242    set_site_transient( 'update_themes', $current_theme );
    243243
    244244    $current_theme->template = get_option( 'template' );
     
    264264    }
    265265
    266     set_transient( 'update_themes', $new_option );
     266    set_site_transient( 'update_themes', $new_option );
    267267}
    268268
     
    270270    global $wp_version;
    271271
    272     $current = get_transient( 'update_core' );
     272    $current = get_site_transient( 'update_core' );
    273273
    274274    if ( isset( $current->last_checked ) &&
     
    291291 */
    292292function _maybe_update_plugins() {
    293     $current = get_transient( 'update_plugins' );
     293    $current = get_site_transient( 'update_plugins' );
    294294    if ( isset( $current->last_checked ) && 43200 > ( time() - $current->last_checked ) )
    295295        return;
     
    307307 */
    308308function _maybe_update_themes( ) {
    309     $current = get_transient( 'update_themes' );
     309    $current = get_site_transient( 'update_themes' );
    310310    if( isset( $current->last_checked ) && 43200 > ( time( ) - $current->last_checked ) )
    311311        return;
Note: See TracChangeset for help on using the changeset viewer.