]
);
+ $this->add_control(
+ 'title_tag',
+ [
+ 'label' => __( 'Balise de titre (SEO)', 'cube' ),
+ 'type' => Controls_Manager::SELECT,
+ 'options' => [
+ 'h1' => __( 'H1', 'cube' ),
+ 'h2' => __( 'H2 (Défaut)', 'cube' ),
+ 'h3' => __( 'H3', 'cube' ),
+ ],
+ 'default' => 'h2',
+ ]
+ );
+
$this->add_control(
'body',
[
protected function render() {
$title = $this->get_settings('title');
+ $title_tag = $this->get_settings('title_tag');
$title_size = $this->get_settings('title_size');
$body = $this->parse_text_editor($this->get_settings('body'));
$cta_text = $this->get_settings('cta_text');
// Rendered content
echo '<div class="text-block">';
- if (!empty($title)) echo "<h2 {$this->get_render_attribute_string('title')}>$title</h2>";
+ if (!empty($title)) echo "<{$title_tag} {$this->get_render_attribute_string('title')}>$title</{$title_tag}>";
if (!empty($body)) echo "<div {$this->get_render_attribute_string('body')}>$body</div>";
if (!empty($cta_text)) {
echo '<a '. $this->get_render_attribute_string('cta_text') .'>';
<div class="text-block">
<# if ('' !== settings.title) { #>
- <h2 {{{ view.getRenderAttributeString( 'title' ) }}}>{{{ settings.title }}}</h2>
+ <{{{ settings.title_tag }}} {{{ view.getRenderAttributeString( 'title' ) }}}>{{{ settings.title }}}</{{{ settings.title_tag }}}>
<# } #>
<# if ('' !== settings.body) { #>