By default, I have a 2m limit of uploads. I want to decrease this number. I found out that this code:
function custom_file_max_upload_size( $file ) {
$size = $file['size'];
if ( $size > 1000 * 1024 ) {
$file['error'] = __( 'ERROR: you cannot upload files larger than 1M', 'textdomain' );
}
return $file;
}
add_filter ( 'wp_handle_upload_prefilter', 'custom_file_max_upload_size', 10, 1 );
works by adding to functions. However, it does not update the upload size information when the user is on upload screen. It still displays Maximum upload file size: 2MB
. How can I change that text to 1mb? Or alternatively, a different approach to decrease the file size (that does not include editing php.ini or htaccess…)