Skip to content

Instantly share code, notes, and snippets.

@webpalych
Last active December 30, 2016 10:29
// хук перед отправкой CF7
function my_function( $contact_form ) {
$title = $contact_form->title();
$submission = WPCF7_Submission::get_instance();
if ( $submission ) {
$posted_data = $submission->get_posted_data();
}
if ( 'Form Title' == $title ) { //нужная ли форма
// Form fields
$name = $posted_data['name'];
$email = $posted_data['coupon-email'];
//код
return true;
}
}
add_action( 'wpcf7_mail_sent', 'my_function', 10 , 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment