-
-
Save farik92/e7f3769f9320c7310d1ee0c9e878a09c to your computer and use it in GitHub Desktop.
Call action on submit wpcf7 form
This file contains hidden or 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
| <?php | |
| 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