Allowing html tags for Administrators and Editors in WPMU
-
How secure do you think the code below is?
I’m trying to allow Administrators and Editors to be able to have these tags available when editing post content, but I wonder why they got removed from the list of default allowed tags anyways.
function tcg_wp_kses_allowed_html($tags, $context) { // Add required HTML TAGS for regular users if($context == "post") { $tags['picture'] = array(); $tags['picture']['class'] = true; $tags['source'] = array(); $tags['source']["class"] = true; $tags['source']["media"] = true; $tags['source']["sizes"] = true; $tags['source']["data-*"] = true; } /** This filter is documented in wp-includes/kses.php */ return $tags; } add_filter('wp_kses_allowed_html', 'tcg_wp_kses_allowed_html', 11, 2);
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.