WP_Theme::cache_delete() WordPress Method

The cache_delete() method is used to clear the cache for a given theme. This can be useful when making changes to a theme and you want those changes to be reflected immediately.

WP_Theme::cache_delete() #

Clears the cache for the theme.


Source

File: wp-includes/class-wp-theme.php

	public function cache_delete() {
		foreach ( array( 'theme', 'screenshot', 'headers', 'post_templates' ) as $key ) {
			wp_cache_delete( $key . '-' . $this->cache_hash, 'themes' );
		}
		$this->template          = null;
		$this->textdomain_loaded = null;
		$this->theme_root_uri    = null;
		$this->parent            = null;
		$this->errors            = null;
		$this->headers_sanitized = null;
		$this->name_translated   = null;
		$this->headers           = array();
		$this->__construct( $this->stylesheet, $this->theme_root );
	}


Top ↑

Changelog

Changelog
VersionDescription
3.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.