wpseek.com
WordPress开发者和主题制作者的搜索引擎
upload_is_file_too_big › WordPress Function
Sincen/a
已弃用n/a
› upload_is_file_too_big ( $upload )
| 参数: |
|
| 返回: |
|
| 定义在: |
|
| 文档: | |
| Change Log: |
|
Checks whether an upload is too big.
Related Functions: upload_space_setting, load_image_to_edit, upload_is_user_over_quota, add_user_to_blog, upload_size_limit_filter
源码
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;
}