With Community Events, users can submit events from the front end of your WordPress site. And with that comes the ability to submit an image. Here, we’ll show you how to limit the file size of the image that they can submit.

The snippet

To change the file size upload, simply add the following snippet to your theme’s functions.php file:

add_filter( 'tribe_community_events_max_file_size_allowed', function() {
    return 1048576; // 1MB
} );

You can alter the number after the “return” portion of the snippet to customize the file size upload. The above option will give you a file size of 1MB.

Note: This snippet may not work, depending on your server settings.  If your server has a more restrictive setting, this will NOT override that. For example, if your server is already set to a max size of 1MB and you try to change it to 2MB, your server may block this from occurring.