Last active
February 4, 2023 12:51
-
-
Save jaredatch/5645033 to your computer and use it in GitHub Desktop.
Modify/change the default allowed tags for bbPress.
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 | |
/** | |
* Modify/change the default allowed tags for bbPress. | |
* | |
* The default list (below) is in bbpress/includes/common/formatting.php, L24-66. | |
* Adjust below as needed. This should go in your theme's functions.php file (or equivilant). | |
*/ | |
function ja_filter_bbpress_allowed_tags() { | |
return 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', 'ja_filter_bbpress_allowed_tags' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment