apply_filters( ‘pre_recurse_dirsize’, int|false $space_used, string $directory, string|string[]|null $exclude, int $max_execution_time, array $directory_cache )

In this article

Filters the amount of storage space used by one directory and all its children, in megabytes.

Description

Return the actual used space to short-circuit the recursive PHP file size calculation and use something else, like a CDN API or native operating system tools for better performance.

Parameters

$space_usedint|false
The amount of used space, in bytes. Default false.
$directorystring
Full path of a directory.
$excludestring|string[]|null
Full path of a subdirectory to exclude from the total, or array of paths.
$max_execution_timeint
Maximum time to run before giving up. In seconds.
$directory_cachearray
Array of cached directory paths.

Source

$size = apply_filters( 'pre_recurse_dirsize', false, $directory, $exclude, $max_execution_time, $directory_cache );

Changelog

VersionDescription
5.6.0Introduced.

User Contributed Notes

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