Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save strangerstudios/19ad6ce612752e52d035 to your computer and use it in GitHub Desktop.
Save strangerstudios/19ad6ce612752e52d035 to your computer and use it in GitHub Desktop.
<?php
/*
* Load iFlyChat Support or Chatroom for Members in Level 1 and 2 Only
* Update line 11 with your Membership Level IDs
*/
function my_pmpro_iflychat_check_access_filter($access) {
$access = true;
/** Get current user information **/
global $current_user;
get_currentuserinfo();
if(is_user_logged_in() && function_exists("pmpro_hasMembershipLevel") && pmpro_hasMembershipLevel(array(1,2)) )
{
$access = true;
}
else
{
$access = false;
}
return $access;
}
add_filter('iflychat_check_access_filter', 'my_pmpro_iflychat_check_access_filter');
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Members-Only Live Chat and Chatrooms using Arrowchat, iFlyChat, Wise Chat, Zopim" at Paid Memberships Pro here: https://www.paidmembershipspro.com/members-live-chat-chatrooms-using-arrowchat-iflychat-wise-chat-zopim/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment