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.

Astra_Cache_Base::delete_cache_files( String $cache_dir )

Deletes cache files


Description


Parameters

$cache_dir

(String) (Required) dirname of the cache.


Return

(void)


Source

File: classes/cache/class-astra-cache-base.php

	private function delete_cache_files( $cache_dir ) {
		$cache_dir   = astra_addon_filesystem()->get_uploads_dir( $cache_dir );
		$cache_files = astra_addon_filesystem()->get_filesystem()->dirlist( $cache_dir['path'], false, true );

		if ( is_array( $cache_files ) ) {

			foreach ( $cache_files as $file ) {
				// don't delete index.php file.
				if ( 'index.php' === $file['name'] ) {
					continue;
				}

				// Delete only dynamic CSS files.
				if ( false === strpos( $file['name'], 'dynamic-css' ) ) {
					continue;
				}

				astra_addon_filesystem()->delete( trailingslashit( $cache_dir['path'] ) . $file['name'], true, 'f' );
			}
		}
	}

Changelog

Changelog
Version Description
2.1.0 Introduced.


User Contributed Notes

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