Skip to content

Instantly share code, notes, and snippets.

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 KaineLabs/3f353546c41cf7fc2fce9665ae4ef9ea to your computer and use it in GitHub Desktop.
Save KaineLabs/3f353546c41cf7fc2fce9665ae4ef9ea to your computer and use it in GitHub Desktop.
Limit Global Activity Stream By Member Type
<?php
/**
* Limit Global Activity Stream By Member Type.
**/
function yzc_limit_activity_page_by_member_type() {
// Get User Member Type
$member_type = bp_get_member_type( bp_loggedin_user_id() );
if ( bp_is_activity_directory() && 'translator' != $member_type ) {
wp_redirect( home_url() );
exit;
}
}
add_action( 'bp_actions', 'yzc_limit_activity_page_by_member_type' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment