Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/f340342a6cf01bbfc7cf72ece8840e64 to your computer and use it in GitHub Desktop.
Save KaineLabs/f340342a6cf01bbfc7cf72ece8840e64 to your computer and use it in GitHub Desktop.
Limit Wall upload By Member Type.
<?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