LLMS_Controller_Registration::voucher( int $person_id, array $data, string $screen )
Attempt to redeem a voucher on user registration if a voucher was submitted during registration
Parameters Parameters
- $person_id
-
(int) (Required) WP_User ID of the newly registered user.
- $data
-
(array) (Required) $_POST data.
- $screen
-
(string) (Required) Screen user registered from [checkout|registration].
Return Return
(void)
Source Source
File: includes/forms/controllers/class.llms.controller.registration.php
public function voucher( $person_id, $data, $screen ) { if ( 'registration' === $screen && ! empty( $data['llms_voucher'] ) ) { $voucher = new LLMS_Voucher(); $redeemed = $voucher->use_voucher( $data['llms_voucher'], $person_id ); if ( is_wp_error( $redeemed ) ) { llms_add_notice( $redeemed->get_error_message(), 'error' ); } } }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.19.4 | Unknown. |
3.0.0 | Introduced. |