-
-
Save agusmu/2663be332c6791cf8bf5 to your computer and use it in GitHub Desktop.
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 | |
function sb_edd_filter_license_limit( $limit, $download_id, $license_id, $price_id ) { | |
$payment_id = get_post_meta( $license_id, '_edd_sl_payment_id', true ); | |
$is_bundle = false; | |
$bundle_items = array(); | |
$downloads = edd_get_payment_meta_downloads( $payment_id ); | |
if( $downloads ) { | |
foreach( $downloads as $download ) { | |
if( 'bundle' == edd_get_download_type( $download['id'] ) && 6013 == $download['id'] ) { | |
$is_bundle = true; | |
$bundle_items = edd_get_bundled_products( $download['id'] ); | |
break; | |
} | |
} | |
} | |
if( $is_bundle && in_array( $download_id, $bundle_items ) ) { | |
return 25; | |
} | |
return $limit; | |
} | |
add_filter( 'edd_get_license_limit', 'sb_edd_filter_license_limit', 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment