Last active
February 3, 2020 08:44
-
-
Save stephenharris/6078242 to your computer and use it in GitHub Desktop.
By default bbpress can be quite strict on the HTML it allows in posts (tags are whitelisted). The following loosens those restrictions and is taken from this post: http://buddypress.org/support/topic/tutorial-allow-more-html-tags-in-bp-forum-topics/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function myprefix_kses_allowed_tags($input){ | |
return array_merge( $input, array( | |
// paragraphs | |
'p' => array( | |
'style' => array() | |
), | |
'span' => array( | |
'style' => array() | |
), | |
// Links | |
'a' => array( | |
'href' => array(), | |
'title' => array(), | |
'rel' => array() | |
), | |
// Quotes | |
'blockquote' => array( | |
'cite' => array() | |
), | |
// Code | |
'code' => array(), | |
'pre' => array(), | |
// Formatting | |
'em' => array(), | |
'strong' => array(), | |
'del' => array( 'datetime' => true, ), | |
// Lists | |
'ul' => array(), | |
'ol' => array( 'start' => true, ), | |
'li' => array(), | |
// Images | |
'img' => array( | |
'src' => true, | |
'border' => true, | |
'alt' => true, | |
'height' => true, | |
'width' => true, | |
) | |
)); | |
} | |
add_filter( 'bbp_kses_allowed_tags', 'myprefix_kses_allowed_tags', 999, 1 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can I add support for videos?
See:
https://bbpress.org/forums/topic/extra-tags-to-add-to-list-for-videos/#post-205701
I added:
But it is not right. The
source
inner component gets stripped.