WordPress.org

Ready to get started?Download WordPress

Plugin Directory

VoucherPress

VoucherPress is a WordPress plugin that allows you to give downloadable, printable vouchers/tickets/coupons/tokens in PDF format away on your site.

= Hooks

=

From version 1.1.2 the plugin also offers a selection of hooks which you can use to run your own custom code. The hooks are:

== voucherpress_create

==

When a voucher is created, this hook returns the properties of the voucher. You can use it like this:

add_action( 'voucherpress_create', 'my_voucherpress_create_function' ); function my_voucherpress_create_function( $id, $name, $text, $description, $template, $require_email, $limit, $startdate, $expiry ) { // do something here... }

== voucherpress_edit

==

When a voucher is edited, this hook returns the properties of the voucher. You can use it like this:

add_action( 'voucherpress_edit', 'my_voucherpress_edit_function' ); function my_voucherpress_edit_function( $id, $name, $text, $description, $template, $require_email, $limit, $startdate, $expiry ) { // do something here... }

== voucherpress_register

==

When someone registers to download a voucher and an email is sent to them, this hook returns the voucher and the users details. You can use it like this:

add_action( 'voucherpress_register', 'my_voucherpress_register_function' ); function my_voucherpress_register_function( $voucher_id, $voucher_name, $user_email, $user_name ) { // do something here... }

== voucherpress_download

==

When someone downloads a voucher, this hook returns the voucher and the users details. You can use it like this:

add_action( 'voucherpress_download', 'my_voucherpress_download_function' ); function my_voucherpress_download_function( $voucher_id, $voucher_name, $code ) { // do something here... }

The plugin also makes use of the __() function to allow for easy translation.

Thanks to Christian Serron (http://twitter.com/cserron) for the code to make the vouchers work in widgets (currently disabled, I'm working on this) and to Barry (http://www.betakeygiveaway.com/) for bug testing above and beyond the call of duty.

Shortcodes

There are four shortcodes available. The first shows a link to a particular voucher, and is in the format:

[voucher id="123"]

The "id" parameter is the unique ID of the voucher. The correct ID to use is available in the screen where you edit the voucher.

You can also how the description after the link:

[voucher id="123" description="true"]

The second shows a link to a voucher, but with a preview of the voucher (just the background image, no text) and the voucher name as the image alternate text:

[voucher id="123" preview="true"]

And you can show the description after the preview as well:

[voucher id="123" preview="true" description="true"]

You can also show an unordered list of all your live vouchers using this shortcode:

[voucherlist]

And a list of all live vouchers with their descriptions:

[voucherlist description="true"]

And you can also show the form for people to enter their name and email address if they wish to register for a restricted voucher:

[voucherform id="123"]

The shortcodes for any voucher can be found on the edit screen for that voucher.

Requires: 2.8 or higher
Compatible up to: 3.8.3
Last Updated: 2014-7-1
Downloads: 27,411

Ratings

3 stars
4 out of 5 stars

Support

0 of 2 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

0,1,0 100,1,1
100,1,1 50,2,1 0,1,0 0,1,0
100,2,2 50,2,1
0,1,0
100,2,2
100,4,4
100,1,1
0,2,0
100,6,6
0,1,0
50,2,1
100,1,1
100,1,1
0,1,0
50,2,1
0,1,0
0,1,0