WP_Theme::cache_delete()publicWP 3.4.0

Clears the cache for the theme.

Method of the class: WP_Theme{}

No Hooks.

Return

null. Nothing (null).

Usage

$WP_Theme = new WP_Theme();
$WP_Theme->cache_delete();

Changelog

Since 3.4.0 Introduced.

WP_Theme::cache_delete() code WP 6.5.2

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->block_theme            = null;
	$this->block_template_folders = null;
	$this->headers                = array();
	$this->__construct( $this->stylesheet, $this->theme_root );
	$this->delete_pattern_cache();
}