функция
since MU (3.0.0)
upload_is_file_too_big()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
upload_is_file_too_big( array $upload ): string|array
Описание
Проверяет, не слишком ли велика загрузка.
Параметры
$upload
array
обязательный
Массив с информацией о только что загруженном файле.
Возвращаемое значение
string|array
Исходный код
wp-includes/ms-functions.php:2140
function upload_is_file_too_big( $upload ) {
if ( ! is_array( $upload ) || defined( 'WP_IMPORTING' ) || get_site_option( 'upload_space_check_disabled' ) ) {
return $upload;
}
if ( strlen( $upload['bits'] ) > ( KB_IN_BYTES * get_site_option( 'fileupload_maxk', 1500 ) ) ) {
/* translators: %s: Maximum allowed file size in kilobytes. */
return sprintf( __( 'This file is too big. Files must be less than %s KB in size.' ) . '<br />', get_site_option( 'fileupload_maxk', 1500 ) );
}
return $upload;
}
История изменений
| Версия | Описание |
|---|---|
| MU (3.0.0) | Introduced. |

