rtec_after_registration_submit
is an action that runs after a valid form is submitted, the entry has been added to the database, and any emails have been sent. It accepts one parameter of the submission object which contains all of the data submitted by the form submitter as well as the event meta and user data (pro only).
Usage
<?php add_action( 'rtec_after_registration_submit', 'function_name' ); ?>
Changelog
Pro
1.2 – introduced
Free
2.0 – introduced
Example: Save phone number data in user meta
function ru_add_phone_to_user_meta( $submission ) {
$sub_data = $submission->submission;
$user_id = get_current_user_id();
// get_current_user_id() returns "0" if visitor is logged out
if ( isset( $sub_data['phone'] ) && $sub_data['phone'] !== '' && $user_id != 0 ) {
update_user_meta( $user_id, 'rtec_phone', $sub_data['phone'] );
}
}
add_action( 'rtec_after_registration_submit', 'ru_add_phone_to_user_meta', 10, 1 );