> wp_kses-compatible allowed tags and attributes */ public static function getAllowedHtmlTags() { $default = wp_kses_allowed_html('post'); $default['script'] = array_fill_keys(['type', 'src', 'id', 'async', 'defer'], true); $default['style'] = array_fill_keys(['type', 'id'], true); $allowed = apply_filters('bitforms_allowed_html_tags', $default); return is_array($allowed) ? $allowed : $default; } /** * Sanitizes HTML for form/shortcode output using the filterable allowed tags list. * * @param string $html Raw HTML to sanitize * @return string Sanitized HTML */ public static function ksesFormOutput($html) { return wp_kses($html, self::getAllowedHtmlTags()); } }