Introduce get/set/delete_site_transient(). Make theme_roots a site transient.

git-svn-id: https://develop.svn.wordpress.org/trunk@12128 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2009-10-29 21:53:57 +00:00
parent 19416faeac
commit 944dad2c59
3 changed files with 105 additions and 5 deletions

View File

@@ -398,8 +398,8 @@ function get_themes() {
$theme_names = array_keys( $themes );
/* Store theme roots in the DB */
if ( get_transient( 'theme_roots' ) != $theme_roots )
set_transient( 'theme_roots', $theme_roots, 7200 ); // cache for two hours
if ( get_site_transient( 'theme_roots' ) != $theme_roots )
set_site_transient( 'theme_roots', $theme_roots, 7200 ); // cache for two hours
foreach ( (array) $theme_names as $theme_name ) {
$themes[$theme_name]['Parent Theme'] = '';
@@ -426,10 +426,10 @@ function get_themes() {
* @return array Theme roots
*/
function get_theme_roots() {
$theme_roots = get_transient( 'theme_roots' );
$theme_roots = get_site_transient( 'theme_roots' );
if ( false === $theme_roots ) {
get_themes();
$theme_roots = get_transient( 'theme_roots' ); // this is set in get_theme()
$theme_roots = get_site_transient( 'theme_roots' ); // this is set in get_theme()
}
return $theme_roots;
}