Opened 3 years ago
Closed 3 years ago
#54170 closed defect (bug) (duplicate)
wp_kses_allowed_html stripping picture tags
Reported by: | shaneonabike | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Formatting | Keywords: | |
Focuses: | Cc: |
Description
Since the latest release of wp_kses_allowed_html
it would appear that the function is stripping picture tags. I don't really understand why these are considered invalid. Specifically: picture, source, media and srcset.
My scenario is to provide better image rendering than the default setup by WordPress so I generate a <picture> tag.
Is it possible to add these to allowed html rather than requiring folks to create a custom filter as I have created below:
add_filter('wp_kses_allowed_html','kses_filter_allowed_html',10,2); function kses_filter_allowed_html($allowed, $context) { if (is_array($context)) return $allowed; if ($context == 'post') { $allowed['picture'] = true; $allowed['source']['media'] = true; $allowed['source']['srcset'] = true; } return $allowed; }
Change History (3)
Note: See
TracTickets for help on using
tickets.
Were they there before?
I would question why
hgroup
is there, butmeter
,noscript
,output
,progress
, andwbr
are not.And why is
title
in the list?