Created
June 27, 2016 10:50
-
-
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.
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
/* | |
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/