The contact-form-7 wpcf7 mail components hook.
Published Date - July 22, 2023
$components = apply_filters( 'wpcf7_mail_components',
$components, wpcf7_get_current_contact_form(), $this
);
$components
$wpcf7_get_current_contact_form
$instance
The following example is for adding a hook callback.
// define the wpcf7_mail_components callback
function custom_wpcf7_mail_components( $components, $wpcf7_get_current_contact_form, $instance ){
//custom code here
return $components
}
//add the action
add_filter('wpcf7_mail_components', 'custom_wpcf7_mail_components', 10, 3)
The filter is defined in the following location(s).
contact-form-7/includes/mail.php
$components = apply_filters( 'wpcf7_mail_components',
$components, wpcf7_get_current_contact_form(), $this
);