Uses
Uses | Description |
---|---|
wp-includes/l10n.php: __() | Retrieve the translation of $text. |
wp-includes/option.php: get_site_option() | Retrieve an option value for the current network based on name of option. |
Check whether an upload is too big.
(array) (Required)
(string|array) If the upload is under the size limit, $upload is returned. Otherwise returns an error message.
File: wp-includes/ms-functions.php
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; }
Version | Description |
---|---|
MU (3.0.0) | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/upload_is_file_too_big