Answer the question
In order to leave comments, you need to log in
Is it possible to use html in shortcode_atts?
Is it possible to somehow use html tags inside shortcode attributes? For example:
function bq_text( $atts, $content = null ) {
extract( shortcode_atts( array(
'text' => '<div class="мой класс">тут DOM дерево</div>'
), $atts ) );
ob_start();
?>
<div>
<div> <?php echo $text; ?></div>
</div>
<?php
$content = ob_get_contents();
ob_end_clean();
return $content;
}
add_shortcode('bq-text', 'bq_text');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question