MemberPress: Add Custom Field Date to Members Table

function custom_admin_members_col($cols) { $cols[‘business_name’] = __(‘Business Name’, ‘memberpress’); // Replace the business_name with the name of the actual custom field key & replace the dummy Business Name text with the name of the actual custom field return $cols; } add_filter(‘mepr-admin-members-cols’,…Continue reading

MemberPress: Disable MemberPress Protection On Specific Page

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 specified page slug or ID if ( is_page( ‘your-page’ ) || is_page( 123 ) ) { $protect = false; // Disable protection for the specified page…Continue reading

MemberPress: Disable MemberPress Protection Based on Custom Post Type And Tag

add_filter(‘mepr-pre-run-rule-content’, ‘mepr_override_content_protection’, 11, 3); function mepr_override_content_protection($protect, $post, $uri) { // Unprotect posts that belong to a specific custom post type (mpcs-lesson), with the “free” tag if (‘mpcs-lesson’ === get_post_type($post->ID) && has_tag(‘free’, $post)) { $protect = false; // Disable protection for…Continue reading

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: Unsubscribed Memberships Shortcode

add_shortcode( ‘mepr-unsubscribed-memberships’, function () { $args = array( ‘post_type’ => ‘memberpressproduct’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ); $memberships = new WP_Query( $args ); ob_start(); if ( $memberships->have_posts() ) { echo ‘ ‘; while ( $memberships->have_posts() ) { $memberships->the_post(); $post_ID…Continue reading

MemberPress: Restrict Signups for US-Based Users

function limit_signups_to_excluded_regions( $errors ) { // Check if the country field is set If ( isset( $_POST[ ‘mepr-address-country’ ] ) ) { $country = sanitize_text_field( wp_unslash( $_POST[ ‘mepr-address-country’ ] ) ); // Exclude EU countries if ( $country == ‘US’…Continue reading

MemberPress: Restrict Signups for EU-Based Users

function limit_signups_to_excluded_regions( $errors ) { // List of EU country codes $eu_countries = array( ‘AT’, ‘BE’, ‘BG’, ‘HR’, ‘CY’, ‘CZ’, ‘DK’, ‘EE’, ‘FI’, ‘FR’, ‘DE’, ‘EL’, ‘HU’, ‘IE’, ‘IT’, ‘LV’, ‘LT’, ‘LU’, ‘MT’, ‘NL’, ‘PL’, ‘PT’, ‘RO’, ‘SK’, ‘SI’, ‘ES’,…Continue reading