Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andrewlimaza/a6dcea937d6d2453f0d11febef9c3a50 to your computer and use it in GitHub Desktop.
Save andrewlimaza/a6dcea937d6d2453f0d11febef9c3a50 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;
wp_get_current_user();
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');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment