Hi Nayeem,
I need dynamically control access rights to individual files and the way, how they are downloaded.
In apply_filters(‘before_download’, $package); I can alter some package fields and change wpdm-start-download.php behavior.
The most usefull for me is ability to change $package[‘url_protect’] on fly right before it is sent to user by \WPDM\libs\FileSystem::downloadFile.
Currently do_action(“wpdm_onstart_download”, $package); in wpdm-start-download.php don’t allow change $package.
apply_filters(‘wpdm_onstart_download’, $package); can save my soul:) if you like to remove ‘before_download’ filter.
Can I change $package[‘url_protect’] field value dynamically before download in the last processing phase?
By the way:
silent removal of documented filters is not a good job.
‘before_download’ is documented and work fine in free version. Buying Pro I got headache in addition because working site with free version become broken when switched to pro.
The similar next issue: in free version DM tags are conneected to post-tag taxonomy. In Pro – to custom wpdmtag taxonomy. So after upgrade database become broken. Of cource it is no problem to write script that restores tags, but, I do think, this should be your job.
It is not a good practice when site using only documented hooks become broken after upgrading from free version to paid.
thanks