Filters the amount of storage space used by one directory and all its children, in megabytes.
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.
$space_usedint|false
$directorystring
$excludestring|string[]|null
$max_execution_timeint
$directory_cachearray
$size = apply_filters( 'pre_recurse_dirsize', false, $directory, $exclude, $max_execution_time, $directory_cache );
| Version | Description |
|---|---|
| 5.6.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/pre_recurse_dirsize