I try to insert a post with html tag
with class
attribute, like this: <dl class="dl-horizontal">
, but after saving the post, WP removes an attribute.
How can I fix it?
The only way I’ve found, is to make a shortcode
:
add_shortcode('attr', 'html_attr');
function html_attr( $atts, $content = null ){
extract( shortcode_atts( array(
'tag' =>"",
'attr'=>""
), $atts ) );
return "<" . $tag . " " . $attr . " >";
}
But I don’t think that it’s a right way…