WordPress at a glance
function is not described

clean_dirsize_cache() WP 5.6.0

Cleans directory size cache used by recurse_dirsize().

Removes the current directory and all parent directories from the dirsize_cache transient.

No Hooks.

Return

null. Null. Nothing.

Usage

clean_dirsize_cache( $path );
$path(string) (required)
Full path of a directory or file.

Changelog

Since 5.6.0 Introduced.

Code of clean_dirsize_cache() WP 5.7.1

<?php
function clean_dirsize_cache( $path ) {
	$directory_cache = get_transient( 'dirsize_cache' );

	if ( empty( $directory_cache ) ) {
		return;
	}

	$path = untrailingslashit( $path );
	unset( $directory_cache[ $path ] );

	while ( DIRECTORY_SEPARATOR !== $path && '.' !== $path && '..' !== $path ) {
		$path = dirname( $path );
		unset( $directory_cache[ $path ] );
	}

	set_transient( 'dirsize_cache', $directory_cache );
}