Created
August 11, 2019 12:46
-
-
Save mklasen/d27f7ea62f301a4f18984e1b575f6714 to your computer and use it in GitHub Desktop.
Easy Digital Downloads: Make software updates for free downloads possible without checking the license key
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 | |
/** | |
* Accept any license key for free downloads. | |
* This assumes that license creation is enabled for the free download | |
*/ | |
add_filter( 'edd_sl_id_license_match', function ( $license_match, $download_id ) { | |
$download = edd_get_download( $download_id ); | |
if ( method_exists( $download, 'is_free' ) ) { | |
if ( $download->is_free() ) { | |
$license_match = true; | |
} | |
} | |
return $license_match; | |
}, 20, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment