Make wporg_theme_feature_list a transient. see #8652

git-svn-id: http://svn.automattic.com/wordpress/trunk@10887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-04-07 21:44:23 +00:00
parent 0c5293c86e
commit bc69a42d12
1 changed files with 5 additions and 6 deletions

View File

@ -73,18 +73,17 @@ function themes_api($action, $args = null) {
* @return array * @return array
*/ */
function install_themes_feature_list( ) { function install_themes_feature_list( ) {
if ( !$cache = get_option( 'wporg_theme_feature_list' ) ) if ( !$cache = get_transient( 'wporg_theme_feature_list' ) )
add_option( 'wporg_theme_feature_list', array( ), '', 'no' ); set_transient( 'wporg_theme_feature_list', array( ), 10800);
if ( $cache && $cache->timeout +3 * 60 * 60 > time( ) ) if ( $cache )
return $cache->cached; return $cache;
$feature_list = themes_api( 'feature_list', array( ) ); $feature_list = themes_api( 'feature_list', array( ) );
if ( is_wp_error( $feature_list ) ) if ( is_wp_error( $feature_list ) )
return $features; return $features;
$cache = (object) array( 'timeout' => time( ), 'cached' => $feature_list ); set_transient( 'wporg_theme_feature_list', $feature_list, 10800 );
update_option( 'wporg_theme_feature_list', $cache );
return $feature_list; return $feature_list;
} }