Forked from strangerstudios/my_wp_bouncer_number_simultaneous_logins.php
Last active
October 31, 2019 09:13
-
-
Save andrewlimaza/212ee6357eddfecca2bcb318d6d3cee6 to your computer and use it in GitHub Desktop.
Change WP Bouncer limit based on user's membership level.
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
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