Skip to content

Instantly share code, notes, and snippets.

@ntwb
Last active December 28, 2023 10:38
Show Gist options
  • Save ntwb/7797990 to your computer and use it in GitHub Desktop.
Save ntwb/7797990 to your computer and use it in GitHub Desktop.
bbPress - Custom KSES Allowed Tags
<?php
/*
Plugin Name: bbPress - Custom KSES Allowed Tags
Plugin URI: https://gist.github.com/ntwb/7797990
Description: bbPress - Custom KSES Allowed Tags
Version: 0.2
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/
add_filter( 'bbp_kses_allowed_tags', 'ntwb_bbpress_custom_kses_allowed_tags' );
function ntwb_bbpress_custom_kses_allowed_tags() {
return array(
// Links
'a' => array(
'class' => true,
'href' => true,
'title' => true,
'rel' => true,
'class' => true,
'target' => true,
),
// Quotes
'blockquote' => array(
'cite' => true,
),
// Div
'div' => array(
'class' => true,
),
// Span
'span' => array(
'class' => true,
),
// Code
'code' => array(),
'pre' => array(
'class' => true,
),
// Formatting
'em' => array(),
'strong' => array(),
'del' => array(
'datetime' => true,
),
// Lists
'ul' => array(),
'ol' => array(
'start' => true,
),
'li' => array(),
// Images
'img' => array(
'class' => true,
'src' => true,
'border' => true,
'alt' => true,
'height' => true,
'width' => true,
),
// Tables
'table' => array(
'align' => true,
'bgcolor' => true,
'border' => true,
),
'tbody' => array(
'align' => true,
'valign' => true,
),
'td' => array(
'align' => true,
'valign' => true,
),
'tfoot' => array(
'align' => true,
'valign' => true,
),
'th' => array(
'align' => true,
'valign' => true,
),
'thead' => array(
'align' => true,
'valign' => true,
),
'tr' => array(
'align' => true,
'valign' => true,
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment