Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@vyskoczilova
Last active February 19, 2018 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vyskoczilova/a44c25bf9ad0fb4e720ba3f47b127a14 to your computer and use it in GitHub Desktop.
Save vyskoczilova/a44c25bf9ad0fb4e720ba3f47b127a14 to your computer and use it in GitHub Desktop.
Upload max filesize | WP Multisite
/**
* @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