Created
July 9, 2019 02:08
-
-
Save KaineLabs/f340342a6cf01bbfc7cf72ece8840e64 to your computer and use it in GitHub Desktop.
Limit Wall upload 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 | |
/** | |
* Limit Wall upload By Member Type. | |
*/ | |
function yzc_limit_wall_upload_by_member_type() { | |
if ( current_user_can( 'administrator' ) ) { | |
return true; | |
} | |
// Get User Member Type | |
$member_type = bp_get_member_type( bp_loggedin_user_id() ); | |
if ( 'author' == $member_type ) { | |
return true; | |
} | |
return false; | |
} | |
add_filter( 'yz_allow_wall_upload_attachments', 'yzc_limit_wall_upload_by_member_type' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment