Last active
February 4, 2019 22:59
-
-
Save bekarice/bafd0c6fc06157138b8a to your computer and use it in GitHub Desktop.
Remove "My Memberships" actions with WooCommerce Memberships
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 | |
/** | |
* Only copy the opening php tag if needed | |
*/ | |
function sv_edit_my_memberships_actions( $actions ) { | |
// remove the "Cancel" action for members | |
unset( $actions['cancel'] ); | |
return $actions; | |
} | |
add_filter( 'wc_memberships_members_area_my-memberships_actions', 'sv_edit_my_memberships_actions' ); | |
add_filter( 'wc_memberships_members_area_my-membership-details_actions', 'sv_edit_my_memberships_actions' ); |
How to programatically cancel the membership?
For example I have two memberships one for trial and another for upgrade. If user upgrade the then automatically the trial memberships will be cancelled.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where do you place this code (or php file) to make it work?