MemberPress: Modify ReadyLaunch Invoice Amount Text to Remove Dot from Swedish Kron (kr.)
function custom_invoice_script() { ?>Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
function custom_invoice_script() { ?>Continue reading
function mepr_product_price($product_price, $coupon_code, $product) { if ($product->ID === 123) { $product_price = 50; } return $product_price; } add_filter(‘mepr_adjusted_price’, ‘mepr_product_price’, 10, 3);Continue reading
function mepr_restrict_email_domains($errors) { # Allowed email domains. $allowed_email_domains = array(‘gmail.com’, ‘hotmail.com’); $email_address = isset($_POST[‘user_email’]) ? sanitize_email(trim($_POST[‘user_email’])) : ”; # Don’t bother validating if the email is empty. if(empty($email_address)) { return $errors; } $user_email_array = explode(‘@’, $email_address); $user_email_domain = array_pop($user_email_array); #…Continue reading
add_action(‘mepr_stripe_create_customer_args’, function ($args, $usr) { $vat = sanitize_text_field($_REQUEST[‘mepr_vat_number’]); //Check one more time to make sure we have a vat number if (isset($vat) && !empty($vat)) { $tax_id = array( “type” => “eu_vat”, //Replace the “eu_vat” value with the predefined value of…Continue reading
add_filter(‘mepr-wp-mail-recipients’, function($recipients, $subject, $message, $headers) { if((strpos($subject, ‘Your Business is at Risk’) !== false)) { foreach ($recipients as $key => $recipient) { if(‘[email protected]’ !== $recipient) { unset($recipients[$key]); } } } return $recipients; }, 10, 4);Continue reading
add_filter(‘mepr-sub-expires-reminder-disable’, function ($disable_email, $reminder, $usr, $prd) { $active_product_subscriptions = $usr->active_product_subscriptions(‘ids’); // Disable reminders if member has any active subscription. if(!empty($active_product_subscriptions)) { $disable_email = true; } return $disable_email; }, 10, 4);Continue reading
//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
add_action(‘wp_head’, function() { ?>Continue reading
// Redirect users after login based on their roles function custom_mepr_login_redirect_url($url, $user) { // Check if the user object is valid if (isset($user->roles) && is_array($user->roles)) { // Roles that should be redirected to the WordPress dashboard $admin_roles = array(‘administrator’, ‘editor’,…Continue reading
function exclude_ml_file_from_search( $query ) { // Check if it is not an admin page, is a search query, and is the main query if ( !$query->is_admin && $query->is_search && $query->is_main_query() ) { // Exclude the ‘mpdl-file’ post type from the…Continue reading