Forked from femiyb/my_pmpro_always_show_renew_levels.php
Last active
July 5, 2024 12:20
-
-
Save MaryOJob/d68e9ef983aa71673f8ff9c564a1c5a5 to your computer and use it in GitHub Desktop.
Always show renew links for certain PMPro levels if the member already has that 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 this line | |
/* | |
* This recipe would always show the renew link on the membership account page for the specified levels on line 13 | |
* Add the below code to your PMPro Customizations Plugin: | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
// always show renew links for certain levels if the member already has that level. | |
function my_pmpro_always_show_renew_levels( $show, $level ){ | |
/*--- change this line to the levels you want to show a renew link---*/ | |
$show_levels = array( 1, 2 ); | |
if( in_array( $level->id, $show_levels ) ) { | |
$show = true; | |
} | |
return $show; | |
} | |
add_filter( 'pmpro_is_level_expiring_soon', 'my_pmpro_always_show_renew_levels', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment