mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 02:34:38 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user