WooCommerce Code Reference

Email_Css_Inliner
in package
implements Css_Inliner

Class for inlining CSS in HTML emails.

Interfaces, Classes and Traits

Css_Inliner

Table of Contents

$inliner  : object|null
The CSS inliner instance.
from_html()  : self
Creates a new instance from HTML content.
inline_css()  : self
Inlines the provided CSS.
render()  : string
Renders the HTML with inlined CSS.
get_inliner_class()  : string
Get the inliner class.

Properties

$inliner

The CSS inliner instance.

private object|null $inliner

Runtime type: Pelago\Emogrifier\CssInliner | Automattic\WooCommerce\Vendor\Pelago\Emogrifier\CssInliner Both classes extend AbstractHtmlProcessor and implement:

  • static fromHtml(string $html): static
  • inlineCss(string $css = ''): self
  • render(): string

Methods

inline_css()

Inlines the provided CSS.

public inline_css([string $css = '' ]) : self
Parameters
$css : string = ''

The CSS to inline.

Tags
throws
LogicException

If from_html() was not called first.

Return values
self

get_inliner_class()

Get the inliner class.

private get_inliner_class() : string

Returns the fully qualified class name for the available CSS inliner. Runtime return type: 'Pelago\Emogrifier\CssInliner' | 'Automattic\WooCommerce\Vendor\Pelago\Emogrifier\CssInliner'

Tags
throws
Exception

If the inliner class is not found.

Return values
stringFully qualified class name