Skip to content

Instantly share code, notes, and snippets.

@pauloiankoski
Created July 22, 2015 18:28
Show Gist options
  • Select an option

  • Save pauloiankoski/8f59a4400c17f6b26cfe to your computer and use it in GitHub Desktop.

Select an option

Save pauloiankoski/8f59a4400c17f6b26cfe to your computer and use it in GitHub Desktop.
Call action on submit wpcf7 form
add_action( 'wpcf7_submit', function( $contact_form, $result ) {
if ( empty( $result['status'] ) || 'mail_sent' != $result['status'] ) {
return;
}
$submission = WPCF7_Submission::get_instance();
if ( ! $submission || ! $posted_data = $submission->get_posted_data() ) {
return;
}
echo '<pre>';
print_r( $posted_data );
echo '</pre>';
exit;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment