By hooking into the wp_kses_allowed_html
filter, you have full control over what HTML is allowed to be displayed in post and comment content.
Unfortunately the $context provided by the filter’s 2nd parameter does not describe the difference between a post and a comment, so we have to alter them all equally.
If you have any thoughts on how to improve this snippet, let me know below!
Discussion