<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing namespace MailPoet\Form\Block; if (!defined('ABSPATH')) exit; use MailPoet\WP\Functions as WPFunctions; class Html { /** @var BlockRendererHelper */ private $rendererHelper; private WPFunctions $wp; public function __construct( BlockRendererHelper $rendererHelper, WPFunctions $wp ) { $this->rendererHelper = $rendererHelper; $this->wp = $wp; } public function render(array $block, array $formSettings): string { $html = ''; $text = ''; if (isset($block['params']['text']) && $block['params']['text']) { $text = html_entity_decode($block['params']['text'], ENT_QUOTES); } if (isset($block['params']['nl2br']) && $block['params']['nl2br']) { $text = nl2br($text); } $classes = isset($block['params']['class_name']) ? " " . $block['params']['class_name'] : ''; $html .= '<div class="mailpoet_paragraph' . $this->wp->escAttr($classes) . '" ' . $this->rendererHelper->renderFontStyle($formSettings) . '>'; $html .= $this->wp->wpKsesPost($text); $html .= '</div>'; return $html; } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
BlockRendererHelper.php | File | 10.02 KB | 0644 |
|
Checkbox.php | File | 2.4 KB | 0644 |
|
Column.php | File | 2.02 KB | 0644 |
|
Columns.php | File | 2.28 KB | 0644 |
|
Date.php | File | 7.85 KB | 0644 |
|
Divider.php | File | 1.97 KB | 0644 |
|
Heading.php | File | 3.56 KB | 0644 |
|
Html.php | File | 1.15 KB | 0644 |
|
Image.php | File | 3.18 KB | 0644 |
|
Paragraph.php | File | 3.22 KB | 0644 |
|
Radio.php | File | 2.31 KB | 0644 |
|
Segment.php | File | 2.82 KB | 0644 |
|
Select.php | File | 3.09 KB | 0644 |
|
Submit.php | File | 1.7 KB | 0644 |
|
Text.php | File | 2.75 KB | 0644 |
|
Textarea.php | File | 2.07 KB | 0644 |
|
index.php | File | 6 B | 0644 |
|