Description
Fires after an invite code has been used for registration.
Parameters
$code_info
(array) An array of details of the code used.
“code_id” | integer | The invite code’s database primary key ID
“user_id” | integer | The user ID of the user
“invite_code” | string | The invite code used to register
“date_used | string | The date the code was used as MySQL timestamp (in string format)
Usage
add_action( 'wpmem_ic_code_used', function( $code_info ) { // The user ID is in the $code_info array. $user_id = $code_info['user_id']; // What is the slug of the membership to assign? $membership = "my-invite-only-membership"; // Assign the membership to the user. wpmem_set_user_membership( $membership, $user_id ); });
Changelog
- Introduced in 2.0.0
Source
wpmem_ic_code_used
is located in includes/class-wp-members-invite-codes.php