From bc69a42d12e0c1e7a28f43ac9930a333531a93c0 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 7 Apr 2009 21:44:23 +0000 Subject: [PATCH] Make wporg_theme_feature_list a transient. see #8652 git-svn-id: http://svn.automattic.com/wordpress/trunk@10887 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/theme-install.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/theme-install.php b/wp-admin/includes/theme-install.php index d7990988f3..bc8b4fc377 100644 --- a/wp-admin/includes/theme-install.php +++ b/wp-admin/includes/theme-install.php @@ -73,18 +73,17 @@ function themes_api($action, $args = null) { * @return array */ function install_themes_feature_list( ) { - if ( !$cache = get_option( 'wporg_theme_feature_list' ) ) - add_option( 'wporg_theme_feature_list', array( ), '', 'no' ); + if ( !$cache = get_transient( 'wporg_theme_feature_list' ) ) + set_transient( 'wporg_theme_feature_list', array( ), 10800); - if ( $cache && $cache->timeout +3 * 60 * 60 > time( ) ) - return $cache->cached; + if ( $cache ) + return $cache; $feature_list = themes_api( 'feature_list', array( ) ); if ( is_wp_error( $feature_list ) ) return $features; - $cache = (object) array( 'timeout' => time( ), 'cached' => $feature_list ); - update_option( 'wporg_theme_feature_list', $cache ); + set_transient( 'wporg_theme_feature_list', $feature_list, 10800 ); return $feature_list; }