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 | |
function remove_basic_membership( $plan, $args ) { | |
// Check that we're purchasing anything other than the basic plan (change number to basic plan id) | |
if ( 123 !== $plan->id ) { | |
$memberships = wc_memberships_get_user_memberships( $args['user_id'] ); | |
foreach ( $memberships as $membership ) { | |
// Check to see if this member has the basic plan | |
// then delete it if so |
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 | |
class My_Custom_My_Account_Endpoint { | |
/** | |
* Custom endpoint name. | |
* | |
* @var string | |
*/ | |
public static $endpoint = 'my-custom-endpoint'; |