wpcf7_mail_components

The contact-form-7 wpcf7 mail components hook.

Published Date - July 22, 2023

Description

$components = apply_filters( 'wpcf7_mail_components',
			$components, wpcf7_get_current_contact_form(), $this
		);

Parameters

  1. $components

  2. $wpcf7_get_current_contact_form

  3. $instance


Usage

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)

Defined

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
		);