Settings_Controller
in package
Class managing the settings for the email editor.
Table of Contents
- ALLOWED_BLOCK_TYPES = array('core/button', 'core/buttons', 'core/paragraph', 'core/heading', 'core/column', 'core/columns', 'core/image', 'core/list', 'core/list-item', 'core/group', 'core/spacer')
- DEFAULT_SETTINGS = array('enableCustomUnits' => array('px', '%'))
- $iframe_assets : array<string|int, mixed>
- Assets for iframe editor (component styles, scripts, etc.)
- $theme_controller : Theme_Controller
- Theme controller.
- __construct() : mixed
- Class constructor.
- get_email_styles() : array{spacing: array{blockGap: string, padding: array{bottom: string, left: string, right: string, top: string}}, color: array{background: string}, typography: array{fontFamily: string}}
- Get the email styles.
- get_layout() : array{contentSize: string, wideSize: string}
- Returns the layout settings for the email editor.
- get_layout_width_without_padding() : string
- Returns the width of the layout without padding.
- get_settings() : array<string|int, mixed>
- Get the settings for the email editor.
- get_theme() : WP_Theme_JSON
- Returns the theme.
- parse_number_from_string_with_pixels() : float
- Returns float number parsed from string with pixels.
- parse_styles_to_array() : array<string|int, mixed>
- Parse styles string to array.
- translate_slug_to_color() : string
- Translate slug to color.
- translate_slug_to_font_size() : string
- Translate slug to font size.
- init_iframe_assets() : void
- Method to initialize iframe assets.
Constants
ALLOWED_BLOCK_TYPES
public
mixed
ALLOWED_BLOCK_TYPES
= array('core/button', 'core/buttons', 'core/paragraph', 'core/heading', 'core/column', 'core/columns', 'core/image', 'core/list', 'core/list-item', 'core/group', 'core/spacer')
DEFAULT_SETTINGS
public
mixed
DEFAULT_SETTINGS
= array('enableCustomUnits' => array('px', '%'))
Properties
$iframe_assets
Assets for iframe editor (component styles, scripts, etc.)
private
array<string|int, mixed>
$iframe_assets
= array()
$theme_controller
Theme controller.
private
Theme_Controller
$theme_controller
Methods
__construct()
Class constructor.
public
__construct(Theme_Controller $theme_controller) : mixed
Parameters
- $theme_controller : Theme_Controller
-
Theme controller.
Return values
mixed —get_email_styles()
Get the email styles.
public
get_email_styles() : array{spacing: array{blockGap: string, padding: array{bottom: string, left: string, right: string, top: string}}, color: array{background: 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}, typography: array{fontFamily: string}} —get_layout()
Returns the layout settings for the email editor.
public
get_layout() : array{contentSize: string, wideSize: string}
Return values
array{contentSize: string, wideSize: string} —get_layout_width_without_padding()
Returns the width of the layout without padding.
public
get_layout_width_without_padding() : string
Return values
string —get_settings()
Get the settings for the email editor.
public
get_settings() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_theme()
Returns the theme.
public
get_theme() : WP_Theme_JSON
Return values
WP_Theme_JSON —parse_number_from_string_with_pixels()
Returns float number parsed from string with pixels.
public
parse_number_from_string_with_pixels(string $value) : float
Parameters
- $value : string
-
Value with pixels.
Return values
float —parse_styles_to_array()
Parse styles string to array.
public
parse_styles_to_array(string $styles) : array<string|int, mixed>
Parameters
- $styles : string
-
Styles string.
Return values
array<string|int, mixed> —translate_slug_to_color()
Translate slug to color.
public
translate_slug_to_color(string $color_slug) : string
Parameters
- $color_slug : string
-
Color slug.
Return values
string —translate_slug_to_font_size()
Translate slug to font size.
public
translate_slug_to_font_size(string $font_size) : string
Parameters
- $font_size : string
-
Font size slug.
Return values
string —init_iframe_assets()
Method to initialize iframe assets.
private
init_iframe_assets() : void