I wrote a small Wordpress plugin which allows adding user defined HTML Custom Element Tags (like
) to the HTML of a Post. So with that a User that doesn't have the capability
is at least capable of using such predefined Custom Tags.
The Problem is if I add a filter like so:
Saving html
is possible. But saving html
is not possible. I think this is because before filtering the HTML Tags with dashes are removed from HTML string.
Is there a good solution (without adjust wordpress core files) to prevent wordpress kses from filtering html tags with dashes?
And I don't want to give the users the
capability.
Code:
<my-element>
Code:
unfiltered_html
The Problem is if I add a filter like so:
Code:
add_filter('wp_kses_allowed_html', 'returnAllowedCustomTags', 10, 2);
function returnAllowedCustomTags($allowedTags, $context) {
$myAllowedTags = array('my-element' = > array(), 'myelement' = > array());
$allowedTags = array_merge($allowedTags, $myAllowedTags);
return $allowedTags;
}
Saving html
Code:
<myelement>blah</myelement>
Code:
<my-element>blah</my-element>
Is there a good solution (without adjust wordpress core files) to prevent wordpress kses from filtering html tags with dashes?
And I don't want to give the users the
Code:
unfiltered_html