easy-digital-downloads icon indicating copy to clipboard operation
easy-digital-downloads copied to clipboard

Allow edd_record_download_in_log to be short-circuited (disabled) via a conditional filter

Open arraypress opened this issue 3 years ago • 2 comments
trafficstars

Enhancement Request

Explain your enhancement (please be detailed)

I am building a custom download add-on for EDD, that uses edd_process_download function. I need a way to disable the log being recorded, because I am inserting own logs and having duplicates does not make sense.

It would probably make the best sense to add a conditional filter in the edd_record_download_in_log function itself.

Justification or use case

Third-party plugin development.

arraypress avatar Jul 27 '22 21:07 arraypress

Probably worth mentioning that the function gets the order, but does not validate it actually exists which will cause it to fail if an order is deleted or destroyed.

arraypress avatar Jul 27 '22 21:07 arraypress

I have submitted a PR for this: #9324

arraypress avatar Jul 28 '22 11:07 arraypress

@cklosowski any chance of this one getting merged? For a new extension I am putting together!

arraypress avatar Sep 05 '22 15:09 arraypress

@davidsherlock This is going to be solved in #8450. We are adding filters for each of the log types with the filters:

edd_should_log_{$data['object_type']}
edd_should_log_file_download
edd_should_log_api_request

We're working on a PR for it in #9397.

cklosowski avatar Sep 06 '22 06:09 cklosowski