Created
June 27, 2016 11:42
-
-
Save strangerstudios/8ea1cc9bbba1087711d1dcc013b327b5 to your computer and use it in GitHub Desktop.
Add a Popup Builder popup everywhere for non-members.
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
/* | |
Add a Popup Builder popup everywhere for non-members. | |
Replace [sg_popup id=1] with the shortcode for your desired popup. | |
Popup Builder is a plugin available in the WordPress.org Repo here: | |
https://wordpress.org/plugins/popup-builder/ | |
*/ | |
function my_pmpro_popup_builder() { | |
global $current_user; | |
if ( !pmpro_hasMembershipLevel() ) | |
{ | |
echo do_shortcode('[sg_popup id=1]'); | |
} | |
} | |
add_action( 'wp_footer', 'my_pmpro_popup_builder'); |
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/