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...
classattribute is not removed when I try it. Maybe you have a plugin conflict or your theme is doing something odd. – s_ha_dum Dec 7 '12 at 14:33spananddivtag I can insertclassand WP does not remove it. But indltag WP removes attributes. – s976 Dec 8 '12 at 16:26<dl>tag since that is the one you are using. It doesn't get stripped when I do it. – s_ha_dum Dec 8 '12 at 16:35