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 | |
| /** | |
| * On a child group member's Directory Profile page, replace the membership_enddate | |
| * display value with the Group Leader's expiration date. | |
| * | |
| * Requires: Paid Memberships Pro, Member Directory Add On, Group Accounts Add On. | |
| * | |
| * 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 | |
| /* | |
| * This gist adds recurring functionality to the Donations Add On for Paid Memberships Pro. | |
| * It adds the user-entered 'donation amount' to their recurring billing amount. | |
| */ | |
| //add donation amount to recurring payment amount | |
| function pmprodon_pmpro_donation_recurring( $level ) { | |
| if ( ! isset( $_REQUEST['donation'] ) ) { | |
| return $level; |
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 is an example. Modify for your use. BACKUP your database before running | |
| /** | |
| * Added SQL to a function. Run once then disable. | |
| * | |
| * Bulk update all users to have an expiration date that belong to a specific membership level. | |
| * 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. | |
| * | |
| * Please update the wp_ prefix to match that of your database as well as the membership_id and enddate value (YYYY-MM-DD). | |
| * |
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 // do not copy this line. | |
| /** | |
| * Force the discount code field to be open on 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/ | |
| */ | |
| function my_open_discount_code_on_checkout() { |
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 | |
| /** | |
| * BCC additional emails on Recurring Payment Receipt emails. | |
| * | |
| * 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/ | |
| */ | |
| function my_pmpro_bcc_membership_recurring_emails( $headers, $email ) { |
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 runs a script to sync your PMPro User Fields (stored in usermeta) with BuddyPress xProfile fields. | |
| * | |
| * Add this recipe to a custom plugin, then run it by visiting: | |
| * `/wp-admin/?pmpromm_process=1` | |
| * | |
| * Remove this recipe when finished. | |
| * | |
| * 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
| /** | |
| * Adjust the Set Expiration Date Add On programmatically. | |
| * Automatically adjust Y1-12-31 to be Y2-12-31 if the current month is December. | |
| * Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_programmatically_change_set_expiration_date( $raw_date ) { | |
| // No Set Expiration Date, just bail. | |
| if ( empty( $raw_date ) ) { | |
| return $raw_date; |
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 PMPro excerpts on pages, keep them enabled elsewhere. | |
| * | |
| * 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 | |
| /** | |
| * Add a “Requires Membership” column to the Posts and Pages lists in the WordPress admin. | |
| * | |
| * title: Add a “Requires Membership” Column to Posts and Pages | |
| * - shows which membership levels are required to view each post or page. | |
| * layout: snippet | |
| * collection: admin-pages | |
| * category: admin | |
| * link: TBD |
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 // do not copy this line. | |
| /** | |
| * This recipe Changes Billing Address to custom wording | |
| * | |
| * 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/ | |
| */ |
NewerOlder