wpcf7_mail_html_header

The contact-form-7 wpcf7 mail html header hook.

Published Date - July 22, 2023

Description

$header = apply_filters( 'wpcf7_mail_html_header',
			'


' . esc_html( $this->get( 'subject', true ) ) . '


', $this );

Parameters

  1. $ . esc_html) .

  2. $instance


Usage

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)

Defined

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