Last active
July 24, 2019 10:23
-
-
Save KaineLabs/0727922e3d5ae792c3111d0b5fea473f to your computer and use it in GitHub Desktop.
Set Max Files Size By Member Type
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 | |
/** | |
* 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