MemberPress: Dynamic Trial Periods

//Sets up a trial period on MemberPress such that ALL users renew on March 31st. function mepr_days_until($date){ return (isset($date)) ? floor((strtotime($date) – time())/60/60/24) : false; } function mepr_update_mepr_trial_period() { $prd = new MeprProduct(123); //CHANGE 123 to the ID of your…Continue reading

MemberPress: Limit Phone Number Digits

function mepr_limit_phone_digits( $errors ) { $phone = isset( $_POST[‘mepr_phone_number’] ) ? sanitize_text_field(trim($_POST[‘mepr_phone_number’])) : ”; // Remove all non-numeric characters from the phone number. $phone = preg_replace(“/[^0-9]/”, “”, $phone); // Check if phone digits equal 11 if (strlen($phone) != 11) {…Continue reading

MemberPress: Override Description for All Payment Methods on Click

jQuery(document).ready(function($) { // Listen for a click event on the payment method label $(document).on(‘click’, ‘.mepr-payment-option-label’, function() { // Loop through all payment method description elements and update the text $(‘.mepr-payment-method-desc-text’).each(function() { var $this = $(this); var newText = ‘New text…Continue reading