WC_Email::clear_alt_body_field()
Clears the PhpMailer AltBody field, to prevent that content from leaking across emails.
Method of the class: WC_Email{}
No Hooks.
Return
null
. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->clear_alt_body_field(): void;
WC_Email::clear_alt_body_field() WC Email::clear alt body field code WC 9.7.1
private function clear_alt_body_field(): void { global $phpmailer; if ( $phpmailer instanceof PHPMailer\PHPMailer\PHPMailer ) { $phpmailer->AltBody = ''; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase } }