Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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