WP_Theme::get_pattern_cache(): array|false

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Gets block pattern cache.

Return

array|false Returns an array of patterns if cache is found, otherwise false.

Source

private function get_pattern_cache() {
	if ( ! $this->exists() ) {
		return false;
	}

	$pattern_data = get_site_transient( 'wp_theme_files_patterns-' . $this->cache_hash );

	if ( is_array( $pattern_data ) && $pattern_data['version'] === $this->get( 'Version' ) ) {
		return $pattern_data['patterns'];
	}
	return false;
}

Changelog

VersionDescription
6.6.0Uses transients to cache regardless of site environment.
6.4.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.