pre_recurse_dirsize WordPress Filter Hook

The pre_recurse_dirsize hook is used to modifies the arguments before recursing through a directory to get its size.

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

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.


Top ↑

Parameters

$space_used

(int|false)The amount of used space, in bytes. Default false.

$directory

(string)Full path of a directory.

$exclude

(string|string[]|null)Full path of a subdirectory to exclude from the total, or array of paths.

$max_execution_time

(int)Maximum time to run before giving up. In seconds.

$directory_cache

(array)Array of cached directory paths.


Top ↑

Source

File: wp-includes/functions.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More