Last active
December 17, 2020 17:46
-
-
Save jessLundie/603d9ef96f6c0d8fc01662fdd1acd3ac to your computer and use it in GitHub Desktop.
Expand access to subscription downloads in WooCommerce Subscriptions based on subscription status
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 expand_access_subscription_downloads( $is_download_permitted, $subscription ) { | |
if ( $subscription->has_status ( 'cancelled', 'expired' ) ) { | |
return true; | |
} | |
return $is_download_permitted; | |
} | |
add_filter ( 'woocommerce_order_is_download_permitted', 'expand_access_subscription_downloads', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@wprebel - Sorry for the delayed response! If still relevant, I recommend adding this code to your site using a plugin such as Code Snippets. You can also add it to your child theme's
functions.php
file.