Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save strangerstudios/17b67cebbc4930a243fbf07c358a0f87 to your computer and use it in GitHub Desktop.
Save strangerstudios/17b67cebbc4930a243fbf07c358a0f87 to your computer and use it in GitHub Desktop.
Enable all Popups - WordPress Popup plugin popups if user has membership level 1.
/*
Enable popups using Popups - WordPress Popup plugin only for users with membership level 1.
Popups is a plugin available in the WordPress.org Repo here:
https://wordpress.org/plugins/popups/
*/
function my_spu_rule_match_membership_level($match, $rule){
global $current_user;
if ( pmpro_hasMembershipLevel(1) )
$match = true;
else
{
return false;
$match = false;
}
return $match;
}
add_filter('spu/rules/rule_match/post_category', 'my_spu_rule_match_membership_level', 12, 2);
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Membership Logic to Enable or Disable Popups for Popular WordPress Popup Plugins" at Paid Memberships Pro here: https://www.paidmembershipspro.com/membership-logic-enable-disable-popups-popup-maker-popups-optinmonster/

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