Created
January 28, 2014 18:49
-
-
Save thenbrent/8673689 to your computer and use it in GitHub Desktop.
Allow customers to download all files associated with a product to which they have purchased a subscription - even after their subscription has been cancelled or expired.
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
<?php | |
/** | |
* Plugin Name: WooCommerce Subscriptions Perpetual Download Access | |
* Description: Allow customers to download all files associated with a product to which they have purchased a subscription - even after their subscription has been cancelled or expired. | |
* Author: | |
* Author URI: | |
* Version: 1.0 | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. | |
* | |
* You should have received a copy of the GNU General Public License | |
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |
* | |
* @author Brent Shepherd | |
* @since 1.0 | |
*/ | |
function eg_allow_perpetual_downloads() { | |
remove_action( 'woocommerce_order_is_download_permitted', 'WC_Subscriptions_Order::is_download_permitted' ); | |
} | |
add_action( 'plugins_loaded', 'eg_allow_perpetual_downloads' ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Based on my testing, it appears that this mini-plugin no longer works because
is_download_permitted
is now deprecated.I created this Gist, which was tested with WCS v. 2.5.2 and appears to work correctly to expand download access to subscriptions with the status of Expired and Cancelled: https://gist.github.com/jessLundie/603d9ef96f6c0d8fc01662fdd1acd3ac