MemberPress: Disable MemberPress Protection On Posts with Specific Tags

add_filter(‘mepr_pre_run_rule_content’, ‘mepr_override_content_protection’, 11, 3); function mepr_override_content_protection($protect, $post, $uri) { // Unprotect posts with the “free” tag and if you want to add more than one tag just add (, ‘tag’) if (has_tag(array(‘free’), $post)) { $protect = false; // Disable protection…Continue reading

MemberPress: Redirect To Specific Page Based on Rule

function mepr_redirect_specific_page( $redirect_url, $delim, $uri ) { $current_post = MeprUtils::get_current_post(); $rules = MeprRule::get_rules( $current_post ); if ( !empty( $rules ) ) { $rule_ids = array_column( $rules, ‘ID’ ); if ( in_array( 123, $rule_ids ) ) { $redirect_url = ‘https://yourdomain.com/register/membership-1/’; }…Continue reading

MemberPress: Whitelist Domains

function mepr_custom_is_domain_whitelisted() { $whitelist = array( “domain.com, domain1.com” ); //comma-separated list of domains $domain = parse_url( $_SERVER[ ‘HTTP_REFERER’ ], PHP_URL_HOST ); if ( !empty($domain ) && in_array( $domain, $whitelist ) ) { return true; //Exclude from paywall } return false;…Continue reading

MemberPress: Mailchimp Feed Unblocker

function allow_mc_through( $block, $post, $uri ) { if( isset( $_GET[‘allow_mailchimp’] ) ) { $block = false; } return $block; } add_filter( ‘mepr_pre_run_rule_content’, ‘allow_mc_through’, 11, 3 );Continue reading

MemberPress: MailChimp Feed Unblocker

function mepr_allow_mc_through( $block, $post, $uri ) { if( isset( $_GET[ ‘allow_mailchimp’ ] ) ) { $block = false; } return $block; } add_filter( ‘mepr_pre_run_rule_content’, ‘mepr_allow_mc_through’, 11, 3 );Continue reading