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; | |
| } |
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 the "Change" link on the Membership Account page for every active member. | |
| * Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_member_action_links( $pmpro_member_action_links, $level_id ) { | |
| // Unset the 'change' action link entirely | |
| if ( isset( $pmpro_member_action_links['change'] ) ) { | |
| unset( $pmpro_member_action_links['change'] ); | |
| } |
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 | |
| /** | |
| * Sync WordPress avatar into BuddyPress, with reliable size enforcement. | |
| * | |
| * @param string $avatar <img> tag or raw URL BP would return. | |
| * @param array $params Params passed to bp_core_fetch_avatar(). | |
| * @return string | |
| */ | |
| function my_pmpro_bp_sync_wordpress_avatar( $avatar, $params ) { | |
| if ( empty( $params['object'] ) || 'user' !== $params['object'] ) { |
NewerOlder