wp_cache_themes_persistently

wp_cache_themes_persistently

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.5.2

apply_filters('wp_cache_themes_persistently') is found 2 times:

  • /wp-includes/class-wp-theme.php line 255
     
    		// Initialize caching on first run.
    		if ( ! isset( self::$persistently_cache ) ) {
    			/** This action is documented in wp-includes/theme.php */
    			self::$persistently_cache = apply_filters( 'wp_cache_themes_persistently', false, 'WP_Theme' );
    			if ( self::$persistently_cache ) {
    				wp_cache_add_global_groups( 'themes' );
    				if ( is_int( self::$persistently_cache ) ) {
    					self::$cache_expiration = self::$persistently_cache;
    				}
    			} else {
    
  • /wp-includes/theme.php line 487
    	 *
    	 * @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.