Hello Themeco Team,
I’m having problems with creating a custom Elements containing two Editor Elements. I have searched the Forums and found one similar Issue, that I tried but it did not resolve my Problem. This is the Forum thread I’m talking about for reference.
The Problem: On the second Editor Element HTML Markup is escaped, causing styles like
<strong>Example</strong>
to not display as Bold Text. Here is a screenshot of the Text-element:
The first element formats each HTML tag just fine, yet the second element, which is build up almost identical, with the exception of a toggle condition to activate/deactivate it, and a required different name for the element has it’s HTML escaped.
here are the respective code-snippets of said element:
controls.php:
'content' => array(
'type' => 'editor',
'context' => 'content',
),
[...]
'content_price' => array(
'type' => 'editor',
'context' => 'content',
'condition' => array(
'c2_toggle' => true,
),
),
defaults.php
return array(
'header' => '',
'subheader' => '',
'content' => '',
'c2_toggle' => true,
'content_price' => '',
'dates' => '',
'swap' => false,
'img' => '',
'price' => '',
'toggle_ab' => false,
'button' => false,
'button_text' => '',
'button_link' => '',
);
shortcode.php
[...]
<div class="pauschale">
<div class="pauschale-image">
<div class="image-section">
<div class="image-wrapper" style="background-image: url(<?php echo $img; ?>);"></div>
</div>
<div class="text-section">
<h3 class="title"><?php echo $header; ?></h3>
<h4 class="subtitle"><?php echo $subheader; ?></h4>
<div class="dates"><span><?php echo __('Zeitraum:','dp-elements') ?></span><?php echo $dates; ?></div>
<div class="description"><?php echo do_shortcode(wpautop($content)); ?></div>
</div>
</div>
<div class="preistext">
<div class="preisliste">
<?php echo do_shortcode(wpautop($content_price)); ?>
</div>
<?php if($price): ?>
<div class="preis"><?php echo $ab . $price?> €</div>
<?php endif; ?>
<?php if($button == true): ?>
<a href="<?php echo $button_link; ?>" class="button btn x-btn"><?php echo $button_text; ?></a>
<?php endif; ?>
</div>
</div>
[...]
The only point that I find intriguing is that i noticed only editor elements with the name ‘content’ are parsed and styled as actual HTML, any other name seems to escape said HTML Markup
Could you please help resolve this issue?