Last active
December 30, 2016 10:29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// хук перед отправкой 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