Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jack-arturo/45b44c586ad1912e37202c022e5b3dd3 to your computer and use it in GitHub Desktop.
Save jack-arturo/45b44c586ad1912e37202c022e5b3dd3 to your computer and use it in GitHub Desktop.
Don't apply "active" tags during a WooCommerce subscriptions renewal
<?php
/**
* Don't apply tags on renewal
*
* @param array $apply_tags The tags to apply.
* @param string $status The status of the subscription.
* @return array The tags to apply.
*/
function dont_apply_tags_on_renewal( $apply_tags, $status ) {
if ( 'active' == $status ) {
$apply_tags = array();
}
return $apply_tags;
}
add_filter( 'wpf_woocommerce_subscription_status_apply_tags', 'dont_apply_tags_on_renewal', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment