Rendering_Context
in package
Class Rendering_Context
Table of Contents
- $theme_json : WP_Theme_JSON
- Instance of the WP Theme.
- __construct() : mixed
- Rendering_Context constructor.
- get_layout_width_without_padding() : string
- Returns the width of the layout without padding.
- get_theme_json() : WP_Theme_JSON
- Returns WP_Theme_JSON instance that should be used during the email rendering.
- get_theme_settings() : array<string|int, mixed>
- Get settings from the theme.
- get_theme_styles() : array{spacing: array{blockGap: string, padding: array{bottom: string, left: string, right: string, top: string}}, color: array{background: string, text: string}, typography: array{fontFamily: string}}
- Get the email theme styles.
- translate_slug_to_color() : string
- Translate color slug to color.
Properties
$theme_json
Instance of the WP Theme.
private
WP_Theme_JSON
$theme_json
Methods
__construct()
Rendering_Context constructor.
public
__construct(WP_Theme_JSON $theme_json) : mixed
Parameters
- $theme_json : WP_Theme_JSON
-
Theme Json used in the email.
Return values
mixed —get_layout_width_without_padding()
Returns the width of the layout without padding.
public
get_layout_width_without_padding() : string
Return values
string —get_theme_json()
Returns WP_Theme_JSON instance that should be used during the email rendering.
public
get_theme_json() : WP_Theme_JSON
Return values
WP_Theme_JSON —get_theme_settings()
Get settings from the theme.
public
get_theme_settings() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_theme_styles()
Get the email theme styles.
public
get_theme_styles() : array{spacing: array{blockGap: string, padding: array{bottom: string, left: string, right: string, top: string}}, color: array{background: string, text: string}, typography: array{fontFamily: string}}
Return values
array{spacing: array{blockGap: string, padding: array{bottom: string, left: string, right: string, top: string}}, color: array{background: string, text: string}, typography: array{fontFamily: string}} —translate_slug_to_color()
Translate color slug to color.
public
translate_slug_to_color(string $color_slug) : string
Parameters
- $color_slug : string
-
Color slug.