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 | |
| /** | |
| * Require a .edu email address when using a specific discount code at checkout. | |
| * | |
| * This recipe checks for a discount code applied via URL or checkout, | |
| * and blocks checkout if the billing email address does not end in .edu. | |
| * | |
| * You can optionally restrict this rule to specific membership levels | |
| * and/or specific discount codes. | |
| * |
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 Member Notes (user_notes) to the PMPro Members List CSV export. | |
| * | |
| * This recipe adds a new "Member Notes" column to the CSV | |
| * and populates it from the user meta key `user_notes`. | |
| * | |
| * 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 | |
| /** | |
| * Limit Member Directory search to display_name only. | |
| * | |
| * 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 | |
| /** | |
| * Hide course overview from non-members | |
| * when using the Default Courses Add On for Paid Memberships Pro. | |
| * | |
| * This prevents non-members from viewing detailed course content blocks | |
| * such as Lesson Overview, Course Description, Requirements, etc. | |
| * | |
| * Add this recipe to your PMPro Customizations Plugin or use the | |
| * Code Snippets plugin. |
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 | |
| /** | |
| * Validate that the State field (bstate) contains only 2 letters. | |
| * Also adds helper text below the input field at 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. | |
| * 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. // TESTING | |
| /** | |
| * Run SQL to bulk update all users in a specific membership level. | |
| * Sets enddate = startdate + 1 year. | |
| * | |
| * Visit https://yoursite.com/wp-admin/?my_query=1 when logged in as an admin to have existing users updated. | |
| * Remove this code when finished. | |
| * | |
| * IMPORTANT: Have a backup of your site before running this code. | |
| */ |
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 | |
| /** | |
| * Remove the "Cancel" membership action link from the account page | |
| * for users with specific membership levels AND a monthly recurring payment plan. | |
| * | |
| * 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 moves the checkout fields to appear in the order of | |
| * 1. Email | |
| * 2. Password. | |
| * | |
| * Email fields will be moved (always) to before password fields | |
| * on the checkout page. | |
| * | |
| * You can add this recipe to your site by creating a custom plugin |
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 | |
| /** | |
| * Dynamically replace instances of "Membership" with custom labels | |
| * based on the user's membership level. Variables like !!first_name!! | |
| * are preserved and skipped during replacements. | |
| * | |
| * 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 | |
| /** | |
| * 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/ |
NewerOlder