geno/wp-content/plugins/mailpoet/lib/Newsletter/Editor/LayoutHelper.php

33 lines
819 B
PHP
Raw Normal View History

2024-02-01 17:24:18 +05:30
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
namespace MailPoet\Newsletter\Editor;
if (!defined('ABSPATH')) exit;
class LayoutHelper {
public static function row($blocks, $styles = []) {
if (empty($styles['backgroundColor'])) {
$styles['backgroundColor'] = 'transparent';
}
return [
'type' => 'container',
'orientation' => 'horizontal',
'styles' => ['block' => $styles],
'blocks' => $blocks,
];
}
public static function col($blocks, $styles = []) {
if (empty($styles['backgroundColor'])) {
$styles['backgroundColor'] = 'transparent';
}
return [
'type' => 'container',
'orientation' => 'vertical',
'styles' => ['block' => $styles],
'blocks' => $blocks,
];
}
}