Created
October 21, 2017 10:30
-
-
Save mvaneijgen/4db072899ae54ef7469519b50f5ddacc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function limit_upload_file_size( $file ) { | |
// Check if upload field is ACF file | |
// Get max upload file size | |
// Set max upload file size to max upload file size of field | |
// else | |
// Max upload file size === 300kb | |
// endif | |
return $file; | |
} | |
add_filter ( 'wp_handle_upload_prefilter', 'limit_upload_file_size', 10, 1 ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment