Automattic\WooCommerce\Internal\EmailEditor
EmailApiController::get_email_by_type
Get the email object by ID.
Метод класса: EmailApiController{}
Хуков нет.
Возвращает
\WC_Email|null. - The email object or null if not found.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_email_by_type( ?string $id ): ?WC_Email;
- ?string $id(обязательный)
- .
Код EmailApiController::get_email_by_type() EmailApiController::get email by type WC 11.2.2
private function get_email_by_type( ?string $id ): ?WC_Email {
foreach ( $this->get_emails() as $email ) {
if ( $email->id === $id ) {
return $email;
}
}
return null;
}