Title: Give same code to user each time they download
Last modified: August 22, 2016

---

# Give same code to user each time they download

 *  [John McAlester](https://wordpress.org/support/users/johnmcalester/)
 * (@johnmcalester)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/give-same-code/)
 * I would like to create a function that hooks to “voucher_download” and checks
   to see if the current user has downloaded this voucher before. If no then issue
   a new code. If yes then insert their previous code into the voucher.
 * Basically, only allow one code per user but allow the user to download the voucher
   more than once.
 * Any hints on how to accomplish this?
 * Thank you! I’ve donated to this great plugin.
 * Cheers,
    John.
 * [https://wordpress.org/plugins/voucherpress/](https://wordpress.org/plugins/voucherpress/)

The topic ‘Give same code to user each time they download’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/voucherpress.svg)
 * [VoucherPress](https://wordpress.org/plugins/voucherpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/voucherpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/voucherpress/)
 * [Active Topics](https://wordpress.org/support/plugin/voucherpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/voucherpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/voucherpress/reviews/)

## Tags

 * [Codes](https://wordpress.org/support/topic-tag/codes/)
 * [users](https://wordpress.org/support/topic-tag/users/)

 * 0 replies
 * 1 participant
 * Last reply from: [John McAlester](https://wordpress.org/support/users/johnmcalester/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/give-same-code/)
 * Status: not resolved