Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Last active July 24, 2019 10:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/0727922e3d5ae792c3111d0b5fea473f to your computer and use it in GitHub Desktop.
Save KaineLabs/0727922e3d5ae792c3111d0b5fea473f to your computer and use it in GitHub Desktop.
Set Max Files Size By Member Type
<?php
/**
* Set Max Files Size By Member Type.
*/
function yzc_edit_files_max_size( $option_value = null, $option_id = null ) {
// Get User Member Types
$member_type = bp_get_member_type( bp_loggedin_user_id() );
if ( $member_type == 'put_your_member_type_here' ) {
return $option_value;
}
if ( $option_id == 'yz_files_max_size' || $option_id == 'yz_attachments_max_size' ) {
// Set Maximum File Size By Megabyte.
$max_size = 50;
return $max_size;
}
return $option_value;
}
add_filter( 'youzer_edit_options', 'yzc_edit_files_max_size', 1, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment