Filter hook 'download_url_error_max_body_size'

in WP Core File wp-admin/includes/file.php at line 1206

View Source

download_url_error_max_body_size

Filter Hook
Description
Filters the maximum error response body size in `download_url()`.

Hook Information

File Location wp-admin/includes/file.php View on GitHub
Hook Type Filter
Line Number 1206

Hook Parameters

Type Name Description
int $size The maximum error response body size. Default 1 KB.

Usage Examples

Basic Usage
<?php
// Hook into download_url_error_max_body_size
add_filter('download_url_error_max_body_size', 'my_custom_filter', 10, 1);

function my_custom_filter($size) {
    // Your custom filtering logic here
    return $size;
}

Source Code Context

wp-admin/includes/file.php:1206 - How this hook is used in WordPress core
<?php
1201  			 *
1202  			 * @see download_url()
1203  			 *
1204  			 * @param int $size The maximum error response body size. Default 1 KB.
1205  			 */
1206  			$response_size = apply_filters( 'download_url_error_max_body_size', KB_IN_BYTES );
1207  
1208  			$data['body'] = fread( $tmpf, $response_size );
1209  			fclose( $tmpf );
1210  		}
1211  

PHP Documentation

<?php
/**
			 * Filters the maximum error response body size in `download_url()`.
			 *
			 * @since 5.1.0
			 *
			 * @see download_url()
			 *
			 * @param int $size The maximum error response body size. Default 1 KB.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/includes/file.php
Related Hooks

Related hooks will be displayed here in future updates.