alch_allowed_editor_html_tags
Filter alch_allowed_editor_html_tags
can be used to change the default HTML tags that are allowed in the Editor field, which uses the global $allowedposttags;
as a default value.
Consider taking a look at [wordpress directory]/wp-includes/kses.php
to see what $allowedposttags
really is.
This filter is applied just before saving the value to the database.
Example
Say we want our Editor fields to allow only <p>
and <strong>
tags which in their turn may only have the class
attribute
Or you can take the passed $tags
argument and correct it to your needs. Say we don't want any attributes on h1
tags and leave the rest as defaults
Last updated