wppaste
WordPress

apply_filters( 'wp_cache_themes_persistently', bool $cache_expiration, string $context )

Since
3.4.0
Filters whether to get the cache of the registered theme directories.

Parameters

$cache_expirationbool
Whether to get the cache of the theme directories. Default false.
$contextstring
The class or function name calling the filter.

Where this hook fires · 2

  • wp-includes/class-wp-theme.php:257WP_Theme::__construct()
  • wp-includes/theme.php:487search_theme_directories()

Source code

	 *	 * @since 3.4.0	 *	 * @param bool   $cache_expiration Whether to get the cache of the theme directories. Default false.	 * @param string $context          The class or function name calling the filter.	 */	$cache_expiration = apply_filters( 'wp_cache_themes_persistently', false, 'search_theme_directories' ); 	if ( $cache_expiration ) {		$cached_roots = get_site_transient( 'theme_roots' );		if ( is_array( $cached_roots ) ) {			foreach ( $cached_roots as $theme_dir => $theme_root ) {				// A cached theme root is no longer around, so skip it.

Changelog

Introduced in 3.4.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.