WordPress removes HTML
Question
This is similar to the other questions around but, the solutions that I’ve seen involve other plugins and things. The closest I’ve found to the “right” fix is
// STOP WORDPRESS REMOVING TAGS
function tags_tinymce_fix( $init )
{
// html elements being stripped
$init['extended_valid_elements'] = 'div[*],article[*]';
// don't remove line breaks
$init['remove_linebreaks'] = false;
// convert newline characters to BR
$init['convert_newlines_to_brs'] = true;
// don't remove redundant BR
$init['remove_redundant_brs'] = false;
// pass back to wordpress
return $init;
}
add_filter('tiny_mce_before_init', 'tags_tinymce_fix');
However, that doesn’t include the Definition list markup, list heads, and I’m sure I’m forgetting some.
Is there a way to make WordPress leave my html alone? There’s no reason to sanitize valid code … We’re not all monkeys …
0
core, functions, html
4 years
2019-10-21T18:26:48-05:00
2019-10-21T18:26:48-05:00 0 Answers
70 views
0
Leave an answer