Skip to content

Instantly share code, notes, and snippets.

Avatar

David Parker dparker1005

  • Stranger Studios
View GitHub Profile
@dparker1005
dparker1005 / my_pmproz_after_checkout_data_discount_code.php
Created Jul 15, 2021
Sends the discount code used to Zapier on the After Checkout trigger.
View my_pmproz_after_checkout_data_discount_code.php
<?php
// Copy from below here...
/**
* Sends the discount code used to Zapier on the After Checkout trigger.
*
* 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 / pmpro_profile_start_date_from_expiration.php
Created Jul 13, 2021
When a user with an enddate renews for a recurring subscription for the same level, do not charge the initial payment and set the first recurring payment date for their old enddate.
View pmpro_profile_start_date_from_expiration.php
<?php
/**
* When a user with an enddate renews for a recurring subscription for the same level,
* do not charge the initial payment and set the first recurring payment date for their
* old enddate.
*
* 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_before_submit_button_hide_ppe.php
Created Jul 6, 2021
Hide PayPal button if user is not approved to check out for this level.
View my_pmpro_checkout_before_submit_button_hide_ppe.php
<?php
/**
* Hide PayPal button if user is not approved to check out for this level.
*
* 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_member_profile_edit_user_object_fields_add_join_date.php
Created Jul 1, 2021
Show the date that the user joined on their frontend profile page.
View my_pmpro_member_profile_edit_user_object_fields_add_join_date.php
<?php
/**
* Show the date that the user joined on their frontend profile 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.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@dparker1005
dparker1005 / my_pmpro_require_email_confirmation_for_checkout.php
Created Jun 8, 2021
Require user to confirm there email address before checking out for specific levels.
View my_pmpro_require_email_confirmation_for_checkout.php
<?php
/*
* Require user to confirm there email address before checking out for specific levels.
* Can build a free level requiring email confirmation for users to sign up for before the "real" levels.
*
* 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 / pmpro_convert_currency.php
Last active Jun 5, 2021
Automatically updates the cost of a membership level to be the local currency amount equivalent to a defined price in a different currency.
View pmpro_convert_currency.php
<?php
// Copy from below here...
/**
* Automatically updates the cost of a membership level to be the local currency amount
* equivalent to a defined price in a different currency.
*
* For example, the default setup below will get the conversion rate from USD to ZAR
* every day and use that information to set the membership price for level ID 5
@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.