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 members to only renew if their membership expires in 45 days or less. | |
| * Only do this for levels that are not recurring. | |
| * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function custom_pmpro_is_level_expiring_soon( $r, $level ) { | |
| if( $level->billing_amount > 0 ) { |
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 | |
| /** | |
| * Stop non-members from purchasing products if they do not have an active Paid Memberships Pro Level. | |
| * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function stop_pmpro_members_from_buying_woo( $is_purchasable, $product ) { | |
| // Check if the user has an active membership 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 //do not copy | |
| /** | |
| * Hook into profile update and send a notification to site admin | |
| * | |
| * @param int $user_id The ID of the user being updated | |
| * @param object $old_user_data The object of the user before it was updated. | |
| * @return void | |
| */ | |
| function my_pmpro_profile_update_notification( $user_id, $old_user_data ) { |
OlderNewer