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 | |
| /** | |
| * Give members of a specific level group a discount to other specific levels, ideally in another level group. | |
| * To qualify for a discount, hold any level in the specified level group. | |
| * | |
| * Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| // Members who hold ANY active level in this group qualify for member pricing. | |
| define( 'MY_PMPRO_MEMBER_PRICING_QUALIFYING_GROUP_ID', 1 ); |
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 | |
| /** | |
| * Show past (date-based) PMPro Events on a page via shortcode. | |
| * Use [pmpro_past_events] on any page you want to show past events. | |
| * | |
| * Follow this guide to add this code to your site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmproe_past_events_styles() { | |
| $post = get_post(); |
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 | |
| // Show renew link on all levels that have an expiration date on the PMPro account page. | |
| function my_pmpro_expiring_soon_if_member_has_enddate( $expiring_soon, $level ) { | |
| if ( empty( $level->id ) || ! is_user_logged_in() ) { | |
| return $expiring_soon; | |
| } | |
| // Get the current user's membership for this level ID, including its assigned enddate. | |
| $member_level = pmpro_getSpecificMembershipLevelForUser( get_current_user_id(), (int) $level->id ); |
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 - groengraag.nl | |
| * Levels 5 (Groene Try-Out) & 6 (De groene maand) only: prevent the submit | |
| * button being clicked more than once, and change its wording while the form | |
| * submits. | |
| * | |
| * Classic [pmpro_checkout] shortcode. Does NOT disable the <input>, so the | |
| * `submit-checkout` value is still POSTed and checkout completes normally. | |
| * |
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 | |
| /** | |
| * Include PDF in the membership expiring email. | |
| * This will get the member's last successful order and attach it. | |
| * Add this code to your site by following this guide - https://yoohooplugins.com/customize-wordpress/ | |
| */ | |
| add_filter( 'pmpropdf_pdf_included_email_templates', function( $templates ) { | |
| // Add membership_expiring to the list of templates that get PDF invoices | |
| $templates[] = 'membership_expiring'; | |
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 | |
| /** | |
| * Creates {{approve_action_link}} and {{deny_action_link}} for pending emails. | |
| * Only add it to the pending approval (admin) email template. | |
| * Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| /** | |
| * Build the frontend URL for an email-based approval or denial action. | |
| * |
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 | |
| /** | |
| * Redirect logged-in users with no BuddyBoss/BuddyPress avatar to the | |
| * membership account page so they can upload a profile photo. | |
| */ | |
| function my_redirect_missing_avatar_to_account() { | |
| if ( is_admin() || wp_doing_ajax() || wp_doing_cron() ) { | |
| return; | |
| } |
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 View and Print Membership Card Link from the Membership Account page. | |
| * To add this code to your site, please visit - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_hide_membership_card_link() { | |
| remove_action( 'pmpro_member_links_top', 'pmpro_membership_card_member_links_top' ); | |
| } | |
| add_action( 'init', 'my_pmpro_hide_membership_card_link' ); |
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 | |
| /** | |
| * For existing group parents, show current seat count and pre-fill the seats field. | |
| * Runs before the group-accounts plugin's own pmpro_checkout_boxes hook (priority 10). | |
| */ | |
| function my_pmpro_group_parent_existing_seats_notice() { | |
| if ( ! function_exists( 'pmprogroupacct_get_settings_for_level' ) || ! class_exists( 'PMProGroupAcct_Group' ) ) { | |
| return; | |
| } |
NewerOlder