import_upload_size_limit
Filter HookDescription
Filters the maximum allowed upload size for import files.Hook Information
File Location |
wp-admin/includes/template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1012 |
Hook Parameters
Type | Name | Description |
---|---|---|
int
|
$max_upload_size
|
Allowed upload size. Default 1 MB. |
Usage Examples
Basic Usage
<?php
// Hook into import_upload_size_limit
add_filter('import_upload_size_limit', 'my_custom_filter', 10, 1);
function my_custom_filter($max_upload_size) {
// Your custom filtering logic here
return $max_upload_size;
}
Source Code Context
wp-admin/includes/template.php:1012
- How this hook is used in WordPress core
<?php
1007 *
1008 * @see wp_max_upload_size()
1009 *
1010 * @param int $max_upload_size Allowed upload size. Default 1 MB.
1011 */
1012 $bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
1013 $size = size_format( $bytes );
1014 $upload_dir = wp_upload_dir();
1015 if ( ! empty( $upload_dir['error'] ) ) :
1016 $upload_directory_error = '<p>' . __( 'Before you can upload your import file, you will need to fix the following error:' ) . '</p>';
1017 $upload_directory_error .= '<p><strong>' . $upload_dir['error'] . '</strong></p>';
PHP Documentation
<?php
/**
* Filters the maximum allowed upload size for import files.
*
* @since 2.3.0
*
* @see wp_max_upload_size()
*
* @param int $max_upload_size Allowed upload size. Default 1 MB.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-admin/includes/template.php
Related Hooks
Related hooks will be displayed here in future updates.