WordPress at Your Fingertips
filter is not described

pre_recurse_dirsize filter-hook . WP 5.6.0

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.

Usage

add_filter( 'pre_recurse_dirsize', 'filter_function_name_2022', 10, 5 );
function filter_function_name_2022( $space_used, $directory, $exclude, $max_execution_time, $directory_cache ){
	// filter...

	return $space_used;
}
$space_used(int|false)
The amount of used space, in bytes.
Default: false
$directory
-
$exclude
-
$max_execution_time
-
$directory_cache
-

Changelog

Since 5.6.0 Introduced.

Where the hook is called

recurse_dirsize()
pre_recurse_dirsize
wp-includes/functions.php 7763
$size = apply_filters( 'pre_recurse_dirsize', false, $directory, $exclude, $max_execution_time, $directory_cache );

Where in WP core the hook is used WordPress

Usage not found.