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 | |
/** | |
* If a user paid by check, give them a $50 discount. | |
*/ | |
function my_pmpro_discount_with_check( $level ) { | |
if ( 'check' === $_REQUEST['gateway'] ) { | |
$level->initial_payment = $level->initial_payment - 50; | |
// $level->billing_amount = $level->billing_amount - 50; //to update recurring payments too |
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 my_gettext_membership( $output_text, $input_text, $domain ) { | |
global $pagenow; | |
if ( ! is_admin() && 'pmproarc' === $domain ) { | |
$output_text = preg_replace( '/Yes, renew at.+$/', 'Allow recurring payments using PayPal', $output_text ); | |
} | |
if ( 'profile.php' === $pagenow ) { | |
$output_text = str_replace( 'Account Management', 'Password Management', $output_text ); | |
} |
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 | |
/** | |
* Disable Redirection to Specific Page | |
*/ | |
function my_wp_redirect($location) { | |
// TODO: Change '10' to the page id that should not be redirected to | |
$page_id = 10; |
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 | |
// Add this function to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
function pmproama_send_invoice( $user_id ) { | |
$order = new MemberOrder(); | |
$order->getLastMemberOrder( $user_id ); | |
$pmproemail = new PMProEmail(); | |
$pmproemail->sendInvoiceEmail( get_userdata( $user_id ), $order ); |
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 my_pmpro_change_stripe_description( $description, $MemberOrder ) { | |
return 'This is my new description.'; | |
} | |
add_filter("pmpro_stripe_order_description", "my_pmpro_change_stripe_description", 10, 2); |
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 my_pmpro_add_personal_data_fields( $fields ) { | |
$fields['meta_name'] = 'Pretty Meta Name'; | |
// Copy the above line for each field you want to include. | |
return $fields; | |
} | |
add_filter( 'pmpro_get_personal_user_meta_fields', 'my_pmpro_add_personal_data_fields' ); | |
function my_pmpro_add_personal_data_fields_to_erase( $fields ) { |
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 | |
// Use the below code to simply move the field | |
// =============================================================================== | |
function my_pmproarc_move_checkout_field() { | |
remove_action('pmpro_checkout_boxes', 'pmproarc_pmpro_checkout_boxes', 15); | |
add_action( 'pmpro_checkout_after_level_cost', 'pmproarc_pmpro_checkout_boxes', 5 ); | |
} | |
add_action( 'init', 'my_pmproarc_move_checkout_field' ); | |
// =============================================================================== |
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 from below this line | |
function my_pmpro_add_name_placeholder() { | |
?> | |
<script> | |
jQuery("#bfirstname").attr("placeholder", "Type your first name here..."); | |
jQuery("#blastname").attr("placeholder", "Type your last name here..."); | |
</script> |
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 from below here | |
/** | |
* Stop adding billing fields to everywhere | |
*/ | |
function my_pmproaffl_init() { | |
remove_action( 'init', 'my_pmproaffl_init_include_address_fields_at_checkout', 30 ); | |
} |