Obtain Name (slug) / title of form upon submission.
-
Can anyone tell me if it is possible to obtain the name of the contact form when users submit a contact form?
I’m using the add_action( ‘wpcf7_before_send_mail’, ‘process_contact_form_data’ ); to process submissions and compare them against another table in the database.
I would like to be able to know what form the submission came from. I have not been able to find any guidance in the documentation to achieve this.
Any insight would be appreciated.
This is what I get when I dump the contents of the form’s data upon submit. It would be great if I can add an item to the array that contained the form’s slug name as stored in the wp_posts table under the post_name field.
array(11) {
["_wpcf7"]=>
string(1) "4"
["_wpcf7_version"]=>
string(5) "4.0.1"
["_wpcf7_locale"]=>
string(5) "en_US"
["_wpcf7_unit_tag"]=>
string(15) "wpcf7-f4-p36-o1"
["_wpnonce"]=>
string(10) "668788e25b"
["your-name"]=>
string(5) "testname"
["your-email"]=>
string(12) "[email protected]"
["your-subject"]=>
string(5) "title"
["radio-203"]=>
array(1) {
[0]=>
string(9) "Attending"
}
["guest"]=>
array(1) {
[0]=>
string(6) "is here"
}
["_wpcf7_is_ajax_call"]=>
string(1) "1"
}
- The topic ‘Obtain Name (slug) / title of form upon submission.’ is closed to new replies.