Gintaras Butkus

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
in reply to: class.Apply.php #148863

Gintaras Butkus
Participant

Everything I need is that this documented hook work as decsribed here in Pro version (it works in free):

Home / Docs / Download Manager Pro / Filter Reference / before_download
https://www.wpdownloadmanager.com/doc/filter-reference/before_download/

Thats all:)

in reply to: class.Apply.php #148836

Gintaras Butkus
Participant

I know this, but it can’t help.

do_action(“wpdm_onstart_download”, $package); // action returns nothing

don’t modify source package. I can get only a $package copy and work with it. Sample shows how to get $package copy.

Only filter has ability to modify current $package instance.

$package = apply_filters(‘before_download’, $package); // filter returns modified source

in reply to: class.Apply.php #148808

Gintaras Butkus
Participant

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

Viewing 3 posts - 1 through 3 (of 3 total)