Skip to content

Instantly share code, notes, and snippets.

Avatar

David Parker dparker1005

  • Stranger Studios
View GitHub Profile
@dparker1005
dparker1005 / my_pmproza_change_level.php
Last active Jun 21, 2021
Modify memberships that are given to users via Zapier. As written, this will change the billing amount shown to $10/year.
View my_pmproza_change_level.php
<?php
// Copy from below here...
/**
* Modify memberships that are given to users via Zapier.
* As written, this will change the billing amount shown to $10/year.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
@dparker1005
dparker1005 / redirect_from_checkout_and_cancel.php
Created Jun 1, 2021
Prevent users from cancelling their membership or checking out for a new one.
View redirect_from_checkout_and_cancel.php
<?php
// Copy from below here...
/**
* Prevent users from cancelling their membership or checking out for a new one.
*/
function my_pmpro_redirect_from_checkout_and_cancel() {
global $pmpro_pages;
View my_pmpro_stripe_params_send_user_id.php
<?php
// Copy from below here...
/**
* Send user ID to Stripe as metadata.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
@dparker1005
dparker1005 / my_custom_get_price_parts.php
Last active May 7, 2021
Example of how to use pmpro_get_price_parts filter alongside PMPro Donations with custom "extras" included in price.
View my_custom_get_price_parts.php
<?php
// Copy from below here...
/**
* Example of how to use pmpro_get_price_parts filter alongside PMPro Donations
* with custom "extras" included in price.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
@dparker1005
dparker1005 / redirect_confirmation_to_member_homepage.php
Last active Apr 27, 2021
Redirects users from the PMPro confirmation page to their membership level's homepage.
View redirect_confirmation_to_member_homepage.php
<?php
// Copy from below here...
/**
* Redirects users from the PMPro confirmation page to their membership level's homepage.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
@dparker1005
dparker1005 / mailchimp_next_payment_date.php
Last active Apr 23, 2021
Send users' next payment date to Mailchimp.
View mailchimp_next_payment_date.php
<?php
// Copy from below here...
/**
* Send users' next payment date to Mailchimp.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
@dparker1005
dparker1005 / my_pmpro_send_expiration_warning_email_level_filter.php
Created Apr 13, 2021
Set specific levels to send expiration warning emails to.
View my_pmpro_send_expiration_warning_email_level_filter.php
<?php
// Copy from below here...
/**
* Set specific levels to send expiration warning emails to.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
@dparker1005
dparker1005 / expiry_log.php
Last active May 10, 2021
Creates a log at /paid-memberships-pro/logs/level-change.txt for whenever a membership is expired.
View expiry_log.php
<?php
// Copy from below here...
/*
* Creates a log at /paid-memberships-pro/logs/level-change.txt for whenever a
* membership is expired.
*/
function my_pmpro_pre_membership_expiry_log( $user_id, $membership_id ) {
global $wpdb;
@dparker1005
dparker1005 / my_pmpro_redirect_after_profile_save.php
Created Apr 9, 2021
Redirect user to the site's homepage after the frontend profile is saved.
View my_pmpro_redirect_after_profile_save.php
<?php
// Copy from below here...
/**
* Redirect user to the site's homepage after the frontend profile is saved.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
@dparker1005
dparker1005 / my_pmpro_confirmation_message_not_success.php
Last active May 10, 2021
Remove the text "Your %s membership is now active" from confirmation message if order does not have "success" status.
View my_pmpro_confirmation_message_not_success.php
<?php
// Copy from below here...
/*
* Remove the text "Your %s membership is now active" from confirmation message
* if order does not have "success" status.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.