Skip to content

Instantly share code, notes, and snippets.

View dparker1005's full-sized avatar

David Parker dparker1005

  • Stranger Studios
View GitHub Profile
@dparker1005
dparker1005 / only_send_recurring_email_for_long_payment_periods.php
Created August 7, 2024 16:40
Only send recurring payment reminder when the last subscription payment was over 6 months ago.
<?php
/**
* Only send recurring payment reminder when the last subscription payment was over 6 months ago.
*
* 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.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*
@dparker1005
dparker1005 / my_pmpro_checkout_custom_template_path_use_default.php
Created April 2, 2024 13:33
Use the default PMPro checkout page template instead of a custom theme tempalate.
<?php
/**
* Use the default PMPro checkout page template instead of a custom theme tempalate.
*
* 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.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@dparker1005
dparker1005 / memberslist_billing_address.php
Created February 28, 2024 16:12
Add the "billing address" column back to the members list and CSV export.
<?php
/**
* Add the "billing address" column back to the members list and CSV export.
*
* Note: This will add the most recent billing address for the user and level
* by looking at the user's order history, not user meta.
*
* 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 / my_remove_pmpro_search_filter_pmpro_pages.php
Last active February 23, 2024 20:20
Disable hiding PMPro pages from search.
<?php
/**
* Disable hiding PMPro pages from search.
*
* 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.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@dparker1005
dparker1005 / my_pmpro_stripe_checkout_session_parameters_subscription_description.php
Last active December 22, 2023 14:19
Updates the payment description in Stripe when purchasing a subscription using Stripe Checkout.
<?php
/**
* 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.
*/
// Copy from below this line
/**
@dparker1005
dparker1005 / redirect_logged_out_users_from_post.php
Created October 23, 2023 13:48
Redirect logged out users from a specific post to the site's login page.
<?php
// Copy below this line.
/**
* Redirect logged out users from a specific post to the site's login page.
*
* 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_pmpromh_prioritized_levels.php
Created October 12, 2023 19:30
Set the level order in which the PMPro Member Homepages Add On should try to redirect members to the corresponding homepage.
<?php
/**
* 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.
*/
// Copy from below this line.
/*
@dparker1005
dparker1005 / rwstripe-trials.php
Last active June 9, 2023 17:29
Give new customers a free trial when purchasing a subscription.
<?php
/**
* 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.
*/
// Copy from below this line
/**
@dparker1005
dparker1005 / pmpro_discount_messages.php
Last active April 7, 2023 15:37
Checks if a certain discount code was used in the checkout and shows messages in multiple places.
<?php
// Copy from below here...
/**
* Checks if a certain discount code was used in the checkout and:
* - Shows a special message on the Confirmation page
* - Includes a special message in the Confirmation email
* - Shows a message on the Invoice for that order/checkout
* - Shows a message on the Account page if the most recent order used the code in the past week
@dparker1005
dparker1005 / my_pmpro_fix_taxonomy_user_field_data.php
Last active March 31, 2023 10:29
On login, loop through all user fields and check if any are taxonomy fields. If so, check the user's meta value for that field. If the taxonomy option label is stored, change it to the ID.
<?php
// Copy from below here...
/**
* On login, loop through all user fields and check if any are taxonomy fields.
* If so, check the user's meta value for that field. If the taxonomy option label
* is stored, change it to the ID.
*
* Upgrade script to go along with this bug fix PR: https://github.com/strangerstudios/paid-memberships-pro/pull/2423