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
*/
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;
}