The contact-form-7 wpcf7 mail html header hook.
Published Date - July 22, 2023
$header = apply_filters( 'wpcf7_mail_html_header',
'
' . esc_html( $this->get( 'subject', true ) ) . '
', $this );
$
$instance
The following example is for adding a hook callback.
// define the wpcf7_mail_html_header callback
function custom_wpcf7_mail_html_header( $
. esc_html) .
, $instance ){
//custom code here
return $
. esc_html) .
}
//add the action
add_filter('wpcf7_mail_html_header', 'custom_wpcf7_mail_html_header', 10, 2)
The filter is defined in the following location(s).
contact-form-7/includes/mail.php
$header = apply_filters( 'wpcf7_mail_html_header',
'<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml"' . $lang_atts . '>
<head>
<title>' . esc_html( $this->get( 'subject', true ) ) . '</title>
</head>
<body>
', $this );