Voucherpress Hooks
-
Just a small suggestion to change the documentation on ‘Hooks’ for Voucherpress. The ‘add_action’ function requires a parameter if the number of arguments being used is greater than one. Otherwise you only receive 1 value in your bespoke callout function.
add_action( string $tag, callable $function_to_add, int $priority = 10, int $accepted_args = 1 )
For example:
add_action( ‘voucherpress_download’, ‘my_voucherpress_download_function’ );
function my_voucherpress_download_function( $voucher_id, $voucher_name, $code ) {
// do something here…
}
Will only return a value in $voucher_idIt should read:
add_action( ‘voucherpress_download’, ‘my_voucherpress_download_function’,10,3);
function my_voucherpress_download_function( $voucher_id, $voucher_name, $code ) {
// do something here…
}Hope that helps others.
- The topic ‘Voucherpress Hooks’ is closed to new replies.