samedi 27 février 2016

What Contact Form 7 action should I hook into for seed submitted data AFTER validation and spam filters?

I'm building an API Integration with a Wordpress Plugin that forwards from's data to CRM's API.

I've got it working on Contact Form 7 by adding an action after 'wpcf7_submit'.

// wpcf7_submit available since ContacForm7 4.1.2, testes with 4.4
add_action("wpcf7_submit", "crm_forward_cf7_to_crm", 10, 2); 

function crm_forward_cf7_to_crm($form,$result) {

  // TODO has spam been filtered already?
  // TODO has form been validated already?

  $submission = WPCF7_Submission::get_instance();
  if ( $submission ) {
    $posted_data = $submission->get_posted_data();
    $posted_data = crm_filter_cf7_data($posted_data);
    crm_post_form($posted_data);
  }
};

My questions are:

Has this submission been filtered out by spam validation (e.g.: akismet) at this point?

Has CF7 validated this form at this point?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire