This file contains hidden or 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... | |
| /* | |
| * Round down initial payment price for users switching levels. | |
| * Useful to make prorated prices look more friendly. | |
| */ | |
| function my_pmpro_checkout_level_round_down_initial_payment( $level ) { | |
| // We only want to round down prorations. |
This file contains hidden or 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... | |
| /* | |
| * Creates a log at /paid-memberships-pro/logs/create_recurring_payments_profile_response.txt for whenever we create | |
| * a recurring payment profile in PayPal. | |
| * | |
| * Useful for debugging a "Missing PROFILESTATUS" error or initial subscription orders in "error" status. | |
| */ |
This file contains hidden or 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 | |
| /** | |
| * Adds last payment date and next payment date to the members list and export CSV. | |
| * Note that "last payment" value will get the last order in "success", "cancelled", or "" status. (Oddly enough, cancelled here means that the membership was cancelled, not the order.) | |
| * | |
| * The "next payment" value is an estimate based on the billing cycle of the subscription and the last order date. It may be off from the actual recurring date set at the gateway, especially if the subscription was updated at the gateway. | |
| * | |
| * 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. |
This file contains hidden or 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... | |
| /** | |
| * When a user logs in, check if they have a sponoring level but don't have | |
| * a sponsor code. If this is the case, create one. | |
| * | |
| * IMPORTANT: If your sponsored members code is set up setting `seats` instead of | |
| * `max_seats`, this code will need to be udpated accordingly. |
This file contains hidden or 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 | |
| /** | |
| * Keeps Stripe subscription attached to membership level after purchasing an Addon Package. | |
| * | |
| * 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/ | |
| */ |
This file contains hidden or 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... | |
| /** | |
| * Make sure that the MemberInvoice class is loaded when using MMPU. | |
| * | |
| * 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. |
This file contains hidden or 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... | |
| /** | |
| * Adds a "Member Since:" field to the WP admin profile. | |
| * | |
| * 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. |
This file contains hidden or 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 | |
| /** | |
| * Make sure that PMPro loads the Stripe library first if other plugins are loading outdated | |
| * versions on every page load. This is a blunt way to address the conflict and should be used | |
| * with caution. | |
| * | |
| * To use, add as a new file in your site's `wp-content/mu-plugins/` folder. | |
| */ | |
| if ( file_exists( dirname( __FILE__ ) . "/../plugins/paid-memberships-pro/includes/lib/Stripe/init.php" ) && ! class_exists( "Stripe\Stripe" ) ) { |
This file contains hidden or 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... | |
| /** | |
| * Have users update their billing information in Stripe Customer Portal. | |
| * | |
| * NOTE: Before using Stripe Customer Portal, you must first enable it by saving the | |
| * customer portal settings page here: | |
| * https://dashboard.stripe.com/settings/billing/portal (For live mode) |
This file contains hidden or 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... | |
| /** | |
| * Increases the number of prices shown in the "Sales and Revenue" report | |
| * widget to 10. | |
| * | |
| * 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. |