awesomemotive / easy-digital-downloads

Sell digital downloads through WordPress
https://easydigitaldownloads.com
GNU General Public License v2.0
868 stars 473 forks source link

Document that edd_ajax_checkout_errors hook clears errors on priority 10 #6114

Open ericnicolaas opened 7 years ago

ericnicolaas commented 7 years ago

The edd_ajax_checkout_errors hook in edd_process_purchase_form is used by edd_print_errors on priority 10, which clears the errors.

As a 3rd party developer, if you want to use this hook it is confusing that edd_get_errors() returns false if you hook in on or after priority 10.

I would suggest documenting this behaviour where the hook is called, and also suggest changing the priority of edd_print_errors to something higher so developers can use the default priority without missing the errors.

cklosowski commented 6 years ago

I think this is actually a great idea, both the documentation, and raising the priority to something higher to 10.