geno/wp-content/plugins/mailpoet/lib/Newsletter/Renderer/Blocks/Spacer.php
2024-02-01 11:54:18 +00:00

22 lines
701 B
PHP

<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
namespace MailPoet\Newsletter\Renderer\Blocks;
if (!defined('ABSPATH')) exit;
use MailPoet\Newsletter\Renderer\EscapeHelper as EHelper;
class Spacer {
public function render($element) {
$height = (int)$element['styles']['block']['height'];
$backgroundColor = EHelper::escapeHtmlAttr($element['styles']['block']['backgroundColor']);
$template = '
<tr>
<td class="mailpoet_spacer" ' .
(($backgroundColor !== 'transparent') ? 'bgcolor="' . $backgroundColor . '" ' : '') .
'height="' . $height . '" valign="top"></td>
</tr>';
return $template;
}
}