Created
November 21, 2018 10:05
-
-
Save bernattorras/58b70c4d18ee01ebf45b26a69f549e0a to your computer and use it in GitHub Desktop.
Remove the subscription switch link if the subscription contains a specific product
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_switch_link( $switch_link, $item_id, $item, $subscription ) { | |
$product_to_check = 336; | |
if( $subscription->has_product( $product_to_check ) ){ | |
return ''; | |
} | |
return $switch_link; | |
} | |
add_filter( 'woocommerce_subscriptions_switch_link', 'remove_switch_link', 100, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment