Created
October 9, 2019 21:49
-
-
Save KaineLabs/3f353546c41cf7fc2fce9665ae4ef9ea to your computer and use it in GitHub Desktop.
Limit Global Activity Stream 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 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