Automattic\WooCommerce\Internal\EmailEditor
EmailApiController::get_email_by_type
Get the email object by ID.
Method of the class: EmailApiController{}
No Hooks.
Returns
\WC_Email|null. - The email object or null if not found.
Usage
// private - for code of main (parent) class only $result = $this->get_email_by_type( ?string $id ): ?WC_Email;
- ?string $id(required)
- .
EmailApiController::get_email_by_type() EmailApiController::get email by type code WC 10.3.6
private function get_email_by_type( ?string $id ): ?WC_Email {
foreach ( $this->emails as $email ) {
if ( $email->id === $id ) {
return $email;
}
}
return null;
}