Last active
April 13, 2021 04:29
-
-
Save strangerstudios/7928fbce3f3756f1f28aaaee995b3304 to your computer and use it in GitHub Desktop.
Disable all Popup Maker 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
/* | |
Disable all Popup Maker popups if user has membership level 1. | |
Popup Maker is a plugin available in the WordPress.org Repo here: | |
https://wordpress.org/plugins/popup-maker/ | |
*/ | |
function my_pmpro_pum_popup_is_loadable( $is_loadable, $popup_id ) { | |
global $current_user; | |
if ( function_exists('pmpro_hasMembershipLevel') && !pmpro_hasMembershipLevel(1) ) | |
$is_loadable = true; | |
else | |
$is_loadable = false; | |
return $is_loadable; | |
} | |
add_filter( 'pum_popup_is_loadable', 'my_pmpro_pum_popup_is_loadable', 1000, 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/