Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MaryOJob/d68e9ef983aa71673f8ff9c564a1c5a5 to your computer and use it in GitHub Desktop.
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.
<?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