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 | |
| /** | |
| * Per-level schedules for the PMPro Extra Expiration Warning Emails Add On. | |
| * | |
| * Edit my_pmproeewe_level_schedules() to set, for each level ID, how many days before | |
| * expiration to send a warning and which email template to use. Levels can share a | |
| * day value with different templates. | |
| * | |
| * How it works: the Add On runs one combined schedule (every day value used by any level). | |
| * For each member it finds, this snippet checks whether the member's level has an 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 | |
| /** | |
| * Redirect members to their BuddyBoss profile page on login. | |
| * | |
| * Uses BuddyBoss's dynamic /members/me/ link, which resolves to the | |
| * logged-in user's profile. Requires the BuddyBoss Platform (or BuddyPress) | |
| * profiles component to be active. | |
| * See: https://buddyboss.com/docs/dynamic-user-profile-links/ | |
| * | |
| * 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 | |
| /** | |
| * Display the "short" level cost text when using the {{ membership_cost }} email variable. | |
| * | |
| * 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_email_data_membership_cost_short( $data, $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 | |
| /** | |
| * Hide the PMPro protected content message card on the blog homepage. | |
| * | |
| * 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_hide_no_access_message_homepage( $html, $level_ids ) { |
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-out visitors away from restricted content to the login page. | |
| * | |
| * When a logged-out visitor hits a post/page that requires membership, | |
| * they are redirected to the login page with a redirect_to parameter | |
| * pointing back to the content. | |
| * | |
| * 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 | |
| /** | |
| * Prevent members from cancelling a membership that has an expiration date. | |
| * | |
| * - Removes the "Cancel" link from the Membership Account page and Billing page | |
| * for any level with an expiration date set for that member. | |
| * - Blocks cancellation processing via the pmpro_cancel_should_process filter. | |
| * | |
| * 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 | |
| /** | |
| * Prevent the Limit Post Views Add On from granting free access to posts in specific categories. | |
| * | |
| * 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 | |
| /** | |
| * Allow Membership Managers to import members using Import Members from CSV. | |
| * | |
| * 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 | |
| /** | |
| * Save the Set Expiration Date from the target Gift Level to the gift discount | |
| * code after gift purchase. | |
| * | |
| * 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 | |
| /** | |
| * Check if a user has an active subscription for a level, | |
| * or a cancelled subscription where the associated membership level is still active | |
| * (paid through until its scheduled expiration date). | |
| * | |
| * @param int $user_id User ID. | |
| * @param int $level_id Membership Level ID. | |
| * @return bool True if active subscription or active paid-through cancelled subscription. | |
| */ |
NewerOlder