Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



upload_is_file_too_big ›

SeitMU
Veraltetn/v
upload_is_file_too_big ( $upload )
Parameter:
  • (array) $upload
    Erforderlich: Ja
Gibt zurück:
  • (string|array) If the upload is under the size limit, $upload is returned. Otherwise returns an error message.
Definiert in:
Codex:

Check whether an upload is too big.



Quellcode

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 ) ) ) {
		return sprintf( __( 'This file is too big. Files must be less than %d KB in size.' ) . '<br />', get_site_option( 'fileupload_maxk', 1500 ) );
	}

	return $upload;
}