woothemes/woocommerce — pull request #3756 by ragulka (2013-09-10 11:34:51+00:00)
Title: Add product download access grant/revoke hooks.

This pull request adds 3 new hooks:

* `woocommerce_grant_product_download_access` - it is fired when `woocommerce_downloadable_file_permission()` is called, which means that it fires for a single file. It receives the `$data` array from the function as it's parameter.

* `woocommerce_grant_product_download_permissions` - it is fired when `woocommerce_downloadable_product_permissions` is called, which means it can be used to trigger an action once all permissions to all downloads have been granted. It receives the $order_id as a single parameter.

* `woocommerce_ajax_revoke_access_to_product_download` - it is fired when access to a download is revoked from the admin panel via ajax. It receives 3 parameters: `$download_id`, `$product_id` and `$order_id`. As a sidenote: there is no other way to revoke access to a download, as far as I know.

Feel free to suggest better names for the actions if you think they are not the best ones. I tried to follow the usual woocommerce pattern, but I'm not sure if I did it right as there are no written instructions for that AFAIK.

PS. I did also fix some of the formatting issues with `wc-order-functions.php` file. It had mixed tabs/spaces for identation and identation was messed up in a few cases.