Created
November 5, 2021 12:52
-
-
Save andrewlimaza/4f07fe8395fe64daa394ac30d891dcad to your computer and use it in GitHub Desktop.
Set the initial amount to $0 for existing members.
This file contains 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 | |
/** | |
* Set the initial price to $0 for members only, for any level. | |
* | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_adjust_initial_amount( $level ) { | |
if ( pmpro_hasMembershipLevel() ) { | |
$level->initial_payment = 0; | |
} | |
return $level; | |
} | |
add_filter( 'pmpro_checkout_level', 'my_pmpro_adjust_initial_amount' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment