Instantly share code, notes, and snippets.

Embed
What would you like to do?
The Events Calendar: Community Events: Limit image upload to 3 megabytes.
<?php
/**
* The Events Calendar: Community Events: Limit image upload to 3 megabytes.
*
* Requires Community Events version 4.5.12 or later.
*
* @see Tribe__Events__Community__Main::max_file_size_allowed
* @see wp_convert_hr_to_bytes()
*
* @link https://gist.github.com/cliffordp/03ddb4913adcdb7d2888ef6a7c7841c9 This snippet.
* @link https://cl.ly/403L0o473b1P 1-minute video demonstrating this snippet works.
*
* @return int
*/
function cliff_ce_max_upload_size() {
return wp_convert_hr_to_bytes( '3M' );
}
add_filter( 'tribe_community_events_max_file_size_allowed', 'cliff_ce_max_upload_size' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment