Last active
March 23, 2022 09:21
-
-
Save cliffordp/03ddb4913adcdb7d2888ef6a7c7841c9 to your computer and use it in GitHub Desktop.
The Events Calendar: Community Events: Limit image upload to 3 megabytes.
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 | |
/** | |
* 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