WP HOOKS
filtrod 5.6.0

pre_recurse_dirsize

Args 5Plik wp-includes/functions.phpDokumentacja WP ↗

Opis — z kodu źródłowego

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.

Parametry

ParametrTypOpis
$space_usedint | falseThe amount of used space, in bytes. Default false.
$directorystringFull path of a directory.
$excludestring | string[] | nullFull path of a subdirectory to exclude from the total, or array of paths.
$max_execution_timeintMaximum time to run before giving up. In seconds.
$directory_cachearrayArray of cached directory paths.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_recurse_dirsize', 'twoja_funkcja', 10, 5 );

function twoja_funkcja($param_1, $param_2, $param_3, $param_4, $param_5) {
	// Twój kod
}

Popularne w tej kategorii