File "BlockWrapperRenderer.php"

Full Path: /home/warrior1/public_html/plugins/mailpoet/lib/Form/BlockWrapperRenderer.php
File size: 548 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

namespace MailPoet\Form;

if (!defined('ABSPATH')) exit;


use MailPoet\WP\Functions as WPFunctions;

class BlockWrapperRenderer {
  /** @var WPFunctions */
  private $wp;

  public function __construct(
    WPFunctions $wp
  ) {
    $this->wp = $wp;
  }

  public function render(array $block, string $blockContent): string {
    $classes = isset($block['params']['class_name']) ? " " . $block['params']['class_name'] : '';
    return '<div class="mailpoet_paragraph' . $this->wp->escAttr($classes) . '">' . $blockContent . '</div>';
  }
}