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 = wp_cache_get( 'wp_theme_patterns_' . $this->stylesheet, 'theme_files' );
	if ( is_array( $pattern_data ) && $pattern_data['version'] === $this->get( 'Version' ) ) {
		return $pattern_data['patterns'];
	}
	return false;
}

Changelog

VersionDescription
6.4.0Introduced.

User Contributed Notes

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