Skip to content

Instantly share code, notes, and snippets.

@jrick1229
Created April 13, 2022 13:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrick1229/4d41bd4792a31d11381ece69c149a2b7 to your computer and use it in GitHub Desktop.
Save jrick1229/4d41bd4792a31d11381ece69c149a2b7 to your computer and use it in GitHub Desktop.
Remove 'Reactivate' button on the My Account page if subscription is set to 'On hold'
<?php
add_filter('wcs_view_subscription_actions', 'wcs_remove_reactivate_button', 99, 2);
function wcs_remove_reactivate_button($actions, $subscription){
$current_status = $subscription->get_status();
if('on-hold' == $current_status){
unset( $actions[ 'reactivate' ] );
}
return $actions;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment