WordPress.org

Make WordPress Core

Changeset 10887


Ignore:
Timestamp:
04/07/09 21:44:23 (5 years ago)
Author:
ryan
Message:

Make wporg_theme_feature_list a transient. see #8652

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/theme-install.php

    r10885 r10887  
    7474 */ 
    7575function install_themes_feature_list( ) { 
    76     if ( !$cache = get_option( 'wporg_theme_feature_list' ) ) 
    77         add_option( 'wporg_theme_feature_list', array( ), '', 'no' ); 
    78  
    79     if ( $cache && $cache->timeout +3 * 60 * 60 > time( ) ) 
    80         return $cache->cached; 
     76    if ( !$cache = get_transient( 'wporg_theme_feature_list' ) ) 
     77        set_transient( 'wporg_theme_feature_list', array( ),  10800); 
     78 
     79    if ( $cache ) 
     80        return $cache; 
    8181 
    8282    $feature_list = themes_api( 'feature_list', array( ) ); 
     
    8484        return $features; 
    8585 
    86     $cache = (object) array( 'timeout' => time( ), 'cached' => $feature_list ); 
    87     update_option( 'wporg_theme_feature_list', $cache ); 
     86    set_transient( 'wporg_theme_feature_list', $feature_list, 10800 ); 
    8887 
    8988    return $feature_list; 
Note: See TracChangeset for help on using the changeset viewer.