Upload max filesize | WP Multisite
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
/** | |
* @snippet Upload max filesize | WP Multisite | |
* @comment Put the correct blog id number in the if condition. Currently set to the main blog. | |
* @source https://kybernaut.cz/clanky/wp-multisite-maximalni-velikost-nahravaneho-souboru/ | |
* @author Karolína Vyskočilová (https://kybernaut.cz) | |
* @testedwith WordPress Multisite 4.9 | |
*/ | |
// ------------------- | |
function custom_filter_fileupload_maxk( $maxk ) { | |
global $current_blog; | |
if ( $current_blog == 1 ) ) { // number = blog id | |
$maxk = 5000; // allowed size in kb | |
} | |
return $maxk; | |
} | |
add_filter( 'pre_site_option_fileupload_maxk', 'custom_filter_fileupload_maxk' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment