akismet
1 year ago
constant-contact
1 year ago
recaptcha
1 year ago
sendinblue
1 year ago
stripe
1 year ago
acceptance.php
1 year ago
checkbox.php
1 year ago
count.php
1 year ago
date.php
1 year ago
disallowed-list.php
1 year ago
doi-helper.php
4 years ago
file.php
1 year ago
flamingo.php
1 year ago
hidden.php
7 years ago
listo.php
2 years ago
number.php
1 year ago
quiz.php
1 year ago
really-simple-captcha.php
1 year ago
reflection.php
3 years ago
response.php
6 years ago
select.php
1 year ago
submit.php
1 year ago
text.php
1 year ago
textarea.php
1 year ago
doi-helper.php
43 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Double Opt-In Helper module |
| 4 | * |
| 5 | * @link https://contactform7.com/doi-helper/ |
| 6 | */ |
| 7 | |
| 8 | |
| 9 | add_action( 'wpcf7_doi', 'wpcf7_doihelper_start_session', 10, 3 ); |
| 10 | |
| 11 | /** |
| 12 | * Starts a double opt-in session. |
| 13 | */ |
| 14 | function wpcf7_doihelper_start_session( $agent_name, $args, &$token ) { |
| 15 | if ( isset( $token ) ) { |
| 16 | return; |
| 17 | } |
| 18 | |
| 19 | if ( ! function_exists( 'doihelper_start_session' ) ) { |
| 20 | return; |
| 21 | } |
| 22 | |
| 23 | $submission = WPCF7_Submission::get_instance(); |
| 24 | |
| 25 | if ( ! $submission ) { |
| 26 | return; |
| 27 | } |
| 28 | |
| 29 | $contact_form = $submission->get_contact_form(); |
| 30 | |
| 31 | $do_doi = apply_filters( 'wpcf7_do_doi', |
| 32 | ! $contact_form->is_false( 'doi' ), |
| 33 | $agent_name, |
| 34 | $args |
| 35 | ); |
| 36 | |
| 37 | if ( ! $do_doi ) { |
| 38 | return; |
| 39 | } |
| 40 | |
| 41 | $token = doihelper_start_session( $agent_name, $args ); |
| 42 | } |
| 43 |