diff --git a/extensions/software-licensing/respect-price_ids-for-download.php b/extensions/software-licensing/respect-price_ids-for-download.php new file mode 100644 index 0000000..78f8a87 --- /dev/null +++ b/extensions/software-licensing/respect-price_ids-for-download.php @@ -0,0 +1,42 @@ +get_license( $license_key, true ); + $price_id = $edd_sl->get_price_id( $license->ID ); + + foreach ( $all_files as $key => $file ) { + if ( isset( $file['condition'] ) && isset( $file['condition'] ) && (int) $price_id === (int) $file['condition'] ) { + $file_url = $file['file']; + } + } + return $file_url; +} +add_filter( 'edd_sl_download_package_url', '_respect_download_by_price_id', 10, 3 );