My shortcode:
function fullwidthFunc($atts, $content = null) {
$atts = shortcode_atts(array(
"backcolor" => 'transparent',
"backimgurl" => '',
"color" => 'black',
"padding" => '50px 10%'
), $atts);
return '<div class="pr-fullwidth-row pr-row" style="background-color: '.esc_attr($atts['backcolor']).'; background-image: url(\''.esc_attr($atts['backimgurl']).'\'); color: '.esc_attr($atts['color']).'; padding: '.esc_attr($atts['padding']).';">'.$content.'</div>';
}
add_shortcode( 'fullwidth', 'fullwidthFunc' );
When I enter plain text (i.e. [fullwidth]This is a test[/fullwidth]
), everything works fine. But, when I enter HTML (i.e. [fullwidth]<h1>This is a test</h1>[/fullwidth]
) it outputs the result as plain text, with the <h1>
tags displayed. Other than this, the entire shortcode works fine.
How do I get the HTML to be processed as HTML?