get_dirsize()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
get_dirsize( string $directory, int $max_execution_time = null ): int|false|null
Описание
Вспомогательная функция, которая используется главным образом для проверки того, не превысил ли блог отведённое ему место для загрузок.
Оригинал (английский)
A helper function that is used primarily to check whether a blog has exceeded its allowed upload space.
Параметры
$directory
string
обязательный
$max_execution_time
int
необязательный
= null
Возвращаемое значение
int|false|null
Исходный код
wp-includes/functions.php:8778
function get_dirsize( $directory, $max_execution_time = null ) {
/*
* Exclude individual site directories from the total when checking the main site of a network,
* as they are subdirectories and should not be counted.
*/
if ( is_multisite() && is_main_site() ) {
$size = recurse_dirsize( $directory, $directory . '/sites', $max_execution_time );
} else {
$size = recurse_dirsize( $directory, null, $max_execution_time );
}
return $size;
}
История изменений
| Версия | Описание |
|---|---|
| MU (3.0.0) | MU (3.0.0) |
| 5.2.0 | Introduced. |

