-
-
Save adnanalbeda/348a0901d82565a7cfecc1e41fba9bc3 to your computer and use it in GitHub Desktop.
Modify/change the default allowed tags for bbPress.
This file contains hidden or 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(), | |
'target' => array(), | |
'style' => array(), | |
), | |
// Quotes | |
'blockquote' => array( | |
'cite' => array(), | |
'style' => array(), | |
), | |
// Code | |
'code' => array( | |
'style' => array(), | |
), | |
'pre' => array(), | |
// Formatting | |
'em' => array( | |
'style' => array(), | |
), | |
'strong' => array( | |
'style' => array(), | |
), | |
'del' => array( | |
'style' => array(), | |
'datetime' => true, | |
), | |
'br' => array( | |
'style' => array(), | |
), | |
'i' => array( | |
'style' => array(), | |
), | |
// Document | |
'div' => array( | |
'style' => array(), | |
), | |
'span' => array( | |
'style' => array(), | |
), | |
'p' => array( | |
'style' => array(), | |
), | |
'h1' => array( | |
'style' => array(), | |
), | |
'h2' => array( | |
'style' => array(), | |
), | |
'h3' => array( | |
'style' => array(), | |
), | |
'h4' => array( | |
'style' => array(), | |
), | |
'h5' => array( | |
'style' => array(), | |
), | |
// Table | |
'table' => array( | |
'style' => array(), | |
), | |
'thead' => array( | |
'style' => array(), | |
), | |
'tbody' => array( | |
'style' => array(), | |
), | |
'tfooter' => array( | |
'style' => array(), | |
), | |
'th' => array( | |
'style' => array(), | |
'colspan' => array(), | |
'align' => array(), | |
), | |
'td' => array( | |
'style' => array(), | |
'rowspan' => array(), | |
'colspan' => array(), | |
'align' => array(), | |
), | |
'tr' => array( | |
'style' => array(), | |
), | |
// Lists | |
'ul' => array( | |
'style' => array(), | |
), | |
'ol' => array( | |
'start' => true, | |
'style' => array(), | |
), | |
'li' => array( | |
'style' => array(), | |
), | |
// Images | |
'img' => array( | |
'src' => true, | |
'border' => true, | |
'alt' => true, | |
'style' => 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