Filters & Hooks

Marc Wag­ner

March 11, 2025

1 min read|

Available filters and hooks #

For deve­lo­pers, we offer the opti­on of acces­sing inte­gra­ted Word­Press hooks to con­nect the sys­tem to exter­nal inter­faces.

Double opt-ins

Allows you to pro­cess opt-ins that have been per­for­med twice. (e.g. if the opt-in link is cli­cked twice).

/**
 * @param string
 * @param OptIn $OptIn
 */
function already_confirmed($hash, $OptIn){
   // Do Something
}
add_action('f12_cf7_doubleoptin_already_confirmed', 'already_confirmed', 10, 2);

Before the opt-in confirmation

Allows you to edit an opt-in befo­re it is saved.

/**
 * @param string
 * @param OptIn $OptIn
 */
function before_confirm($hash, $OptIn){
   // Do Something
}
add_action('f12_cf7_doubleoptin_before_confirm', 'before_confirm', 10, 2);

After the opt-in confirmation

Allows the opt-in to be modi­fied after con­fir­ma­ti­on. Also allows the opt-in to be pas­sed to inter­faces after con­fir­ma­ti­on.

/**
 * @param string
 * @param OptIn $OptIn
 */
function after_confirm($hash, $OptIn){
   // Do Something
}
add_action('f12_cf7_doubleoptin_after_confirm', 'after_confirm', 10, 2);

After sending the opt-in mail

Allows fur­ther steps to be car­ri­ed out after the opt-in mail has been sent.

/**
 * @param array $form_data - An Array containing all dynamic form fields and placeholder data.
 * @param int $post_id - The Form ID
 */
function after_optin_mail_sent($form_data, $post_id){
   // Do Something
}
add_action('f12_cf7_doubleoptin_sent', 'after_optin_mail_sent', 10, 2);

Advanced CF7 DB — Exclude mail from tracking

If you are using the Advan­ced CF7 DB plug­in and do not want to cap­tu­re the opt-in mail, for exam­p­le, you can sim­ply use the fol­lo­wing code:

/**
 * Remove Advanced CF7 DB Hook for Opt-in Mails.
 */
add_action('f12_cf7_doubleoptin_sent', function($form, $form_id){
    remove_action('wpcf7_before_send_mail','vsz_cf7_before_send_email');
}, 10, 2);
88e86fcb816eff22bc917094df2862d8dd5c0e978b333e6dd5f36f808990c261 96

Artic­le from:

Marc Wag­ner

Hi Marc here. I’m the foun­der of Forge12 Inter­ac­ti­ve and have been pas­sio­na­te about buil­ding web­sites, online stores, appli­ca­ti­ons and SaaS solu­ti­ons for busi­nesses for over 20 years. Befo­re foun­ding the com­pa­ny, I alre­a­dy work­ed in publicly lis­ted com­pa­nies and acqui­red all kinds of know­ledge. Now I want to pass this know­ledge on to my cus­to­mers.

Do you have a ques­ti­on? Plea­se lea­ve a com­ment