4

How do you display or process HTML in a wrapped shortcode ?

[myshortcode]<div class="map"></div>[/myshortcode]

my shortcode code is

function myshortcode_sc($atts, $content = null) {
extract( shortcode_atts( array(
    'col' => 'left',
    ), $atts ) );

$output =  '<div class="span' . esc_attr($col) . '">' . do_shortcode($content) . '</div>';  

return $output;

}
add_shortcode("myshortcode", "myshortcode_sc");

is there another function at the return to allow for $output to process the HTML and not just display it as text ?

2 Answers 2

3

Maybe try replacing

. do_shortcode($content) .

with .$content. ?

Source: http://wp.smashingmagazine.com/2009/02/02/mastering-wordpress-shortcodes/

-2

my solution : do_shortcode(html_entity_decode($content)) But not working with ' & " :/

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.