WPCF7_Mail::__construct
The constructor method.
Метод класса: WPCF7_Mail{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->__construct( $name, $template );
- $name(строка) (обязательный)
- The name of the email template. Such as
'mail'or'mail_2'. - $template(массив) (обязательный)
- Array of email template.
Код WPCF7_Mail::__construct() WPCF7 Mail:: construct CF7 6.1.5
private function __construct( $name, $template ) {
$this->name = trim( $name );
$this->use_html = ! empty( $template['use_html'] );
$this->exclude_blank = ! empty( $template['exclude_blank'] );
$this->template = wp_parse_args( $template, array(
'subject' => '',
'sender' => '',
'body' => '',
'recipient' => '',
'additional_headers' => '',
'attachments' => '',
) );
if ( $submission = WPCF7_Submission::get_instance() ) {
$contact_form = $submission->get_contact_form();
$this->locale = $contact_form->locale();
}
}