Created
June 23, 2015 07:35
-
-
Save woogist/edcfd945bf858222bf08 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
add_action( 'subscription_expired', 'wc_custom_remove_subscription', 5, 2 ); | |
function wc_custom_remove_subscription( $user_id, $subscription_key ) { | |
$subscription = WC_Subscriptions_Manager::get_subscription( $subscription_key ); | |
if ( isset( $subscription['product_id'] ) && isset( $subscription['order_id'] ) ) { | |
$product_id = $subscription['product_id']; | |
if ( $product_id == 100 ) { | |
remove_action( 'subscription_expired', array( 'Groups_WS_Handler', 'subscription_expired' ), 10, 2 ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment