Checks whether an upload is too big.
Parameters
$upload
arrayrequired- An array of information about the newly-uploaded file.
Source
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;
}
Changelog
Version | Description |
---|---|
MU (3.0.0) | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.