before_download

Viewing 4 posts - 1 through 4 (of 4 total)
#183911

Sander Vercampt
Participant

Hello,

Should the before_download action work in the free version?

before_download

I can’t get it to work

Thanks!

#183914

Humayon Kabir
Moderator

Hi,

Thank you for writing to us.

The before_download filter should work in the free version as well.

If it doesn’t work then can you please let us know what output you are trying to achieve?

Regards

#183926

Sander Vercampt
Participant

Hi,

I’m trying to add an extra check for rights.
Before someone is downloading the file (he clicks on the link), I want to check if he has all the rights needed to download the file.
So I was thinking to check that in the before_download, if not I want to redirect to another page.

I added the example code that was given in the docs in my functions.php, but the action is not triggered…

add_filter('before_download', 'wpdm_before_download_package', 10, 1);

function wpdm_before_download_package($package)
{
//todo: Modify any package settings. This changes made here are only for current requested download if you do not update the option.
  var_dump('Test before download');exit();
  return $package;
}

If I’m correct I should get ‘Test before download’ if I try to download the file??

Thanks!

#183962

Shahjada
Keymaster

Please use:

wpdm_onstart_download

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

You must be logged in to reply to this topic.