Custom module "editor" field html render problem

Hi, i created a plugin with some custom modules for the pro theme, everything is working fine except one thing. If i use any html tags in the editor input area and click save i see that the html isn’t rendered and i see many tags on my content.

This is how i am declaring the field:

	'text_content' => array(
	'type'    => 'editor',
	'context' => 'content',
	'suggest' => __( 'Click to inspect, then edit as needed.', 'my-extension' ),
    ),

And this is how i am calling it:

<?php if ( $text_content ) : ?>
     <div class="column-slider__content" style="color:<?php echo $text_color; ?>"><?php echo $text_content; ?></div>
<?php endif; ?>

No html is being rendered - please see my screenshot.

thanks

Hi @l_eckardt,

Try using the htmlspecialchars_decode() function so that you will have the HTML codes in variables work as normal.

For example

<?php if ( $text_content ) : ?>
     <div class="column-slider__content" style="color:<?php echo $text_color; ?>"><?php echo htmlspecialchars_decode( $text_content ); ?></div>
<?php endif; ?>

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.