Filters the contact creation arguments assembled from a form submission, just before the contact record is created or updated. Use this to modify or normalise field values.
apply_filters( 'groundhogg/form/submission_handler/contact_args', $args );
You will receive the associative array of contact arguments (e.g. first_name, last_name, email).
Example
add_filter( 'groundhogg/form/submission_handler/contact_args', 'my_extension_normalise_phone' );
/**
* Normalise the phone number format before the contact is created.
*
* @param array $args
*
* @return array
*/
function my_extension_normalise_phone( $args ) {
if ( ! empty( $args['phone_number'] ) ) {
$args['phone_number'] = my_extension_format_phone( $args['phone_number'] );
}
return $args;
}
Was this helpful?
Let us know if this document answered your question. Thatβs the only way we can improve.
