Automattic\WooCommerce\Vendor\Pelago\Emogrifier\HtmlProcessor
AbstractHtmlProcessor::ensureDocumentType
Makes sure that the passed HTML has a document type, with lowercase "html".
Метод класса: AbstractHtmlProcessor{}
Хуков нет.
Возвращает
string. HTML with document type
Использование
// private - только в коде основоного (родительского) класса $result = $this->ensureDocumentType( $html ): string;
- $html(строка) (обязательный)
- .
Код AbstractHtmlProcessor::ensureDocumentType() AbstractHtmlProcessor::ensureDocumentType WC 11.2.1
private function ensureDocumentType(string $html): string
{
$hasDocumentType = \stripos($html, '<!DOCTYPE') !== false;
if ($hasDocumentType) {
return $this->normalizeDocumentType($html);
}
return self::DEFAULT_DOCUMENT_TYPE . $html;
}