MemberPress: Allow Importing Coupons Associated With Affiliates (Easy Affiliate)

function mpimp_load_expanded_coupon_importer() { global $mpimp; $mpimp->importers[‘couponaffiliate’] = ‘MpimpExtendedCouponsImporter’; } add_action(‘admin_init’, ‘mpimp_load_expanded_coupon_importer’, 110); //has to be after the MP hook function runs class MpimpExtendedCouponsImporter extends MpimpCouponsImporter { public function form() { } public function import($row,$args) { $ea_active = is_plugin_active(‘easy-affiliate/easy-affiliate.php’) ? true…Continue reading

MemberPress: Auto Approve Sub-Accounts with New User Approve Plugin

function mepr_newuser_approve_override($user_id) { // Define an array of membership IDs for which the verification step should be skipped. $auto_approve = array(123, 456, 789); if(!class_exists(‘MeprOptions’)) { return; } if(!isset($_POST[‘mepr_product_id’]) && !isset($_POST[‘manage_sub_accounts_form’])) { return $user_id; } $product_id = isset($_POST[‘mepr_product_id’])?$_POST[‘mepr_product_id’]:false; if(isset($_POST[‘manage_sub_accounts_form’]) || ($product_id…Continue reading

MemberPress: Display User’s Course Progress in MemberPress Courses

add_shortcode( ‘mpcs_user_courses_progress’, function() { $user_id = get_current_user_id(); $courses = get_posts(array( ‘posts_per_page’ => -1, ‘post_type’ => ‘mpcs-course’ )); ob_start(); echo ‘ ‘; foreach ( $courses as $course ) { $course = new memberpress\courses\models\Course($course->ID); $progress = $course->user_progress($user_id); if ( $progress < 100…Continue reading

MemberPress: Change Courses Listing Page Link

add_filter( ‘post_type_archive_link’, function ( $link, $post_type ) { if ( $post_type == ‘mpcs-course’ ) { $link = home_url() . ‘/courses/’; //replace the word courses with the custom page or post slug } return $link; }, 10, 2 );Continue reading

MemberPress: Change Stripe Checkout Description

function mepr_change_stripe_checkout_desc($desc, $payment) { if (isset($payment->settings->stripe_checkout_enabled) && $payment->settings->stripe_checkout_enabled == ‘on’) { $desc = “Pay with Apple Pay”; // Edit this. } return $desc; } add_filter(‘mepr_signup_form_payment_description’, ‘mepr_change_stripe_checkout_desc’, 10, 2);Continue reading