Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andrewlimaza/212ee6357eddfecca2bcb318d6d3cee6 to your computer and use it in GitHub Desktop.
Save andrewlimaza/212ee6357eddfecca2bcb318d6d3cee6 to your computer and use it in GitHub Desktop.
Change WP Bouncer limit based on user's membership level.
function my_wp_bouncer_number_simultaneous_logins($num) {
// Bail if PMPro not activated or function not available.
if ( ! function_exists( 'pmpro_hasMembershipLevel' ) ) {
return $num;
}
if ( pmpro_hasMembershipLevel( '1' ) ) {
$num = 1;
}
if ( pmpro_hasMembershipLevel( '2' ) ) {
$num = 999;
}
return $num;
}
add_filter('wp_bouncer_number_simultaneous_logins', 'my_wp_bouncer_number_simultaneous_logins');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment