Add support for creating styles from block attributes e.g., text alignment styles

MAILPOET-5643
This commit is contained in:
Oluwaseun Olorunsola
2023-11-13 16:54:44 +04:00
committed by Jan Lysý
parent 4567c6d3c1
commit 0d771a7fc5
3 changed files with 71 additions and 2 deletions

View File

@ -91,6 +91,8 @@ class SettingsController {
],
];
private $availableStylesheets = '';
public function getSettings(): array {
$coreDefaultSettings = get_default_block_editor_settings();
$coreThemeData = \WP_Theme_JSON_Resolver::get_core_data();
@ -113,6 +115,13 @@ class SettingsController {
return self::DEFAULT_EMAIL_CONTENT_STYLES;
}
public function getAvailableStylesheets(): string {
if ($this->availableStylesheets) return $this->availableStylesheets;
$coreThemeData = \WP_Theme_JSON_Resolver::get_core_data();
$this->availableStylesheets = $coreThemeData->get_stylesheet();
return $this->availableStylesheets;
}
/**
* @return array{width: string, background: string, padding: array{bottom: string, left: string, right: string, top: string}}
*/