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-admin/includes/update.php

    r12066 r12673  
    3232function get_core_updates( $options = array() ) {
    3333    $options = array_merge( array('available' => true, 'dismissed' => false ), $options );
    34     $dismissed = get_option( 'dismissed_update_core' );
     34    $dismissed = get_site_option( 'dismissed_update_core' );
    3535    if ( !is_array( $dismissed ) ) $dismissed = array();
    36     $from_api = get_transient( 'update_core' );
     36    $from_api = get_site_transient( 'update_core' );
    3737    if ( empty($from_api) )
    3838        return false;
     
    5858
    5959function dismiss_core_update( $update ) {
    60     $dismissed = get_option( 'dismissed_update_core' );
     60    $dismissed = get_site_option( 'dismissed_update_core' );
    6161    $dismissed[ $update->current.'|'.$update->locale ] = true;
    62     return update_option( 'dismissed_update_core', $dismissed );
     62    return update_site_option( 'dismissed_update_core', $dismissed );
    6363}
    6464
    6565function undismiss_core_update( $version, $locale ) {
    66     $dismissed = get_option( 'dismissed_update_core' );
     66    $dismissed = get_site_option( 'dismissed_update_core' );
    6767    $key = $version.'|'.$locale;
    6868    if ( !isset( $dismissed[$key] ) ) return false;
    6969    unset( $dismissed[$key] );
    70     return update_option( 'dismissed_update_core', $dismissed );
     70    return update_site_option( 'dismissed_update_core', $dismissed );
    7171}
    7272
    7373function find_core_update( $version, $locale ) {
    74     $from_api = get_transient( 'update_core' );
     74    $from_api = get_site_transient( 'update_core' );
    7575    if ( !is_array( $from_api->updates ) ) return false;
    7676    $updates = $from_api->updates;
     
    149149    $all_plugins = get_plugins();
    150150    $upgrade_plugins = array();
    151     $current = get_transient( 'update_plugins' );
     151    $current = get_site_transient( 'update_plugins' );
    152152    foreach ( (array)$all_plugins as $plugin_file => $plugin_data) {
    153153        if ( isset( $current->response[ $plugin_file ] ) ) {
     
    161161
    162162function wp_plugin_update_rows() {
    163     $plugins = get_transient( 'update_plugins' );
     163    $plugins = get_site_transient( 'update_plugins' );
    164164    if ( isset($plugins->response) && is_array($plugins->response) ) {
    165165        $plugins = array_keys( $plugins->response );
     
    172172
    173173function wp_plugin_update_row( $file, $plugin_data ) {
    174     $current = get_transient( 'update_plugins' );
     174    $current = get_site_transient( 'update_plugins' );
    175175    if ( !isset( $current->response[ $file ] ) )
    176176        return false;
     
    208208function get_theme_updates() {
    209209    $themes = get_themes();
    210     $current = get_transient('update_themes');
     210    $current = get_site_transient('update_themes');
    211211    $update_themes = array();
    212212
Note: See TracChangeset for help on using the changeset viewer.