pre_recurse_dirsize хук-фильтр . 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.
Использование
add_filter( 'pre_recurse_dirsize', 'filter_function_name_3376', 10, 5 ); function filter_function_name_3376( $space_used, $directory, $exclude, $max_execution_time, $directory_cache ){ // filter... return $space_used; }
- $space_used(число/false)
- The amount of used space, in bytes.
По умолчанию: false - $directory
- -
- $exclude
- -
- $max_execution_time
- -
- $directory_cache
- -
Список изменений
С версии 5.6.0 | Введена. |
Где вызывается хук
pre_recurse_dirsize
wp-includes/functions.php 7676
$size = apply_filters( 'pre_recurse_dirsize', false, $directory, $exclude, $max_execution_time, $directory_cache );