This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Copy the lines below this one into a plugin like Code Snippets (run everywhere type) | |
function mepr_pw_changed_message( $message, $recipients, $subject, $headers ) { | |
if ( strpos( $subject, 'Your new Password' ) !== false ) { | |
$message = 'This is a modified message'; // Change 'This is a modified message'. | |
} | |
return $message; | |
} | |
add_filter( 'mepr-wp-mail-message', 'mepr_pw_changed_message', 10, 4 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mepr_completed_recurring_transaction( $event ) { | |
$transaction = $event->get_data(); | |
if ( $transaction->subscription_id > 0 && $transaction->product_id == 76026 ) { | |
// Subscription id is greater than zero, so it's a recurring subscription. | |
// Make sure the transaction's product ID is 76026. | |
$sub = $transaction->subscription(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mepr_forward_old_ipn() { | |
if ( ! isset( $_GET['option'] ) && $_GET['option'] != 'com_osmembership' || empty( $_POST ) ) { | |
return; | |
} | |
$memberpress_ipn_url = 'https://www.site.com/mepr/notify/pja675-3wu/ipn'; // CHANGE THIS | |
wp_remote_post( $memberpress_ipn_url, array( 'body' => stripslashes_deep( $_POST ), 'sslverify' => false ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Copy the lines below this one into a plugin like Code Snippets (run everywhere type) | |
function mepr_change_lc_paypal( $args ) { | |
$args['lc'] = 'fr_CA'; | |
return $args; | |
} | |
add_filter( 'mepr_paypal_std_payment_vars', 'mepr_change_lc_paypal', 10, 1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mepr_hide_post_code_stripe_elements( $hide ) { | |
return true; | |
} | |
add_filter( 'mepr-stripe-form-hide-postal-code', 'mepr_hide_post_code_stripe_elements' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mepr_subscription_num_days() { | |
$user_id = get_current_user_id(); | |
if ( 0 == $user_id ) { | |
return; | |
} | |
$user = new MeprUser( $user_id ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mepr_restrict_coupons_by_memberships( $errors ) { | |
$coupon = isset( $_POST['mepr_coupon_code'] ) && ! empty( $_POST['mepr_coupon_code'] ) ? $_POST['mepr_coupon_code'] : ''; | |
$user_id = get_current_user_id(); | |
if ( $coupon == 'COUPON' && $user_id == 0 ) { | |
// User doesn't have an account yet, so turn down their coupon attempt. | |
$errors['mepr_coupon_denied'] = 'You cannot use this coupon.'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$debug_file = fopen( 'debug.txt', 'a' ); | |
$text = 'The data was sent.'; | |
fwrite( $debug_file, $text ); | |
fclose( $debug_file ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
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 ); |
OlderNewer