clean_dirsize_cache()
最后更新于:2021-11-25 20:33:09
clean_dirsize_cache( string$path)Cleans directory size cache used by recurse_dirsize().
参数
- $path
-
(string) (Required) Full path of a directory or file.
源文件
文件: gc-includes/functions.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 );
}