Skip to content

Instantly share code, notes, and snippets.

@mklasen
Created August 11, 2019 12:46
Show Gist options
  • Save mklasen/d27f7ea62f301a4f18984e1b575f6714 to your computer and use it in GitHub Desktop.
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
<?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