diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php index 5f29a408b..a84aebeb3 100644 --- a/wp-admin/theme-editor.php +++ b/wp-admin/theme-editor.php @@ -94,6 +94,7 @@ case 'update': fwrite( $f, $newcontent ); fclose( $f ); $location .= '&updated=true'; + $theme->cache_delete(); } } wp_redirect( $location ); diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index c5eea5c24..85b4584af 100644 --- a/wp-includes/class-wp-theme.php +++ b/wp-includes/class-wp-theme.php @@ -154,7 +154,7 @@ final class WP_Theme implements ArrayAccess { * @access private * @var bool */ - private static $cache_expiration = 7200; + private static $cache_expiration = 1800; /** * Constructor for WP_Theme. @@ -503,6 +503,9 @@ final class WP_Theme implements ArrayAccess { public function cache_delete() { foreach ( array( 'theme', 'screenshot', 'screenshot_count', 'files', 'headers', 'page_templates' ) as $key ) wp_cache_delete( $key . '-' . $this->cache_hash, 'themes' ); + $this->template = $this->textdomain_loaded = $this->theme_root_uri = $this->parent = $this->errors = $this->headers_sanitized = $this->name_translated = null; + $this->headers = array(); + $this->__construct( $this->stylesheet, $this->theme_root ); } /** diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 40cb5b4bb..8bfdd74a5 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -351,10 +351,9 @@ function search_theme_directories( $force = false ) { return $found_themes; } if ( ! is_int( $cache_expiration ) ) - $cache_expiration = 7200; + $cache_expiration = 1800; // half hour } else { - // Two hours is the default. - $cache_expiration = 7200; + $cache_expiration = 1800; // half hour } /* Loop the registered theme directories and extract all themes */