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 | |
/** | |
* Move a specific user field group (e.g. Company Info) below the Billing Address on PMPro Checkout. | |
* | |
* This uses JavaScript to reposition any fieldset by targeting its ID. | |
* Update the `$fieldset_id` value to match the fieldset you want to move. | |
* | |
* 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. | |
* 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 | |
/** | |
* This recipe redirects members to their Specific (with URL) User Page on login | |
* and non-members to the PMPro membership levels page. | |
* | |
* This recipe assumes the User Pages Add On is installed and configured. | |
* @link https://www.paidmembershipspro.com/add-ons/pmpro-user-pages/ | |
* | |
* 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. |
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 | |
/** | |
* This recipe will redirect users after checkout based on a Discount Code OR their Membership Level. | |
* | |
* It hooks into the `template_redirect` action and is useful when the default `pmpro_confirmation_url` filter | |
* does not work reliably, such as with off-site gateways like Stripe Checkout. | |
* | |
* 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 | |
/** | |
* PMPro Customization: Prorate Initial Payment Based on Fixed Renewal Date. requires Subscription Delays Add On | |
* | |
* This recipe adjusts the initial payment for a membership level to reflect a prorated charge | |
* from the join date until a fixed annual renewal date (e.g., October 1). | |
* The membership level should have its Subscription Delay set to: `Y1-10-01` | |
*/ | |
function my_pmprosd_prorate_delay( $level ) { | |
// Only apply to specific level ID(s) — update as needed. |
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 | |
/** | |
* This stops users from accessing restricted products directly with Paid Memberships Pro. | |
* Tested on WooCommerce 3.4 and up. | |
* You may be interested with the following gist for removing products from WooCommerce shop page - https://gist.github.com/andrewlimaza/6ee480694d38a99695503febe3cdabf1 | |
* Add the following function to your PMPro Customizations plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Visit https://www.paidmembershipspro.com for any questions or assistance. | |
*/ |
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 | |
/** | |
* Add Website Field to PMPro Checkout, Frontend Profile Edit, and Admin Member Edit Screen. | |
* | |
* - Adds a "Website" field to checkout, user profile edit, and admin member edit screen. | |
* - Saves the website URL correctly to the default WordPress `user_url` field. | |
*/ | |
/** | |
* Add Website field to PMPro Checkout Form. |
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 | |
/** | |
* This recipe will add a fee to the initial and recurring value when using Stripe | |
* including when a payment plan is selected. | |
* | |
* 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 | |
/** | |
* Donation notes. | |
* Edit the copy below. | |
* Add to a custom plugin. | |
* Notes are now saved into the order meta instead of the order notes. | |
*/ | |
// Show the donation notes field at checkout (Always visible) |
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 | |
/** | |
* Disable any automatic phone number formatting in Paid Memberships Pro. | |
* | |
* This ensures phone numbers are displayed exactly as entered by the member. | |
* | |
* Add this code to your PMPro Customizations Plugin | |
* - 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 | |
/** | |
* Adjust expiration date based on a defined cutoff date for Paid Memberships Pro. | |
* | |
* If a user signs up or renews on or after the defined cutoff date, | |
* their membership expiration date is extended by a specified period | |
* (e.g., December 31 of the next year). | |
* If they sign up or renew before the cutoff, the expiration date | |
* is set to a different period (e.g., December 31 of the current year). | |
* |
NewerOlder