Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Last active April 13, 2021 04:29
Show Gist options
  • Save strangerstudios/7928fbce3f3756f1f28aaaee995b3304 to your computer and use it in GitHub Desktop.
Save strangerstudios/7928fbce3f3756f1f28aaaee995b3304 to your computer and use it in GitHub Desktop.
Disable all Popup Maker popups if user has membership level 1.
/*
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 );
@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