版本1.10.2
Bricks 将允许的 HTML 标签限制为 WordPress 核心逻辑wp_kses_allowed_html( 'post' )
。
这导致允许使用以下现成的 HTML 标签:
address, a, abbr, acronym, area, article, aside, audio, b, bdo, big, blockquote, br, button, caption, cite, code, col, colgroup, del, dd, dfn, details, div, dl, dt, em, fieldset, figure, figcaption, font, footer, h1, h2, h3, h4, h5, h6, header, hgroup, hr, i, img, ins, kbd, label, legend, li, main, map, mark, menu, nav, object, p, pre, q, rb, rp, rt, rtc, ruby, s, samp, span, section, small, strike, strong, sub, summary, sup, table, tbody, td, textarea, tfoot, th, thead, title, tr, track, tt, u, ul, ol, var, video
例如,form
默认情况下不允许在“块”元素上设置“自定义标签”,并且会在构建器中引发以下错误:
使用如下面的代码片段所示的新过滤器,form
标签被添加到允许的 HTML 标签列表中,并且可以在没有抛出任何错误的情况下使用。
add_filter( 'bricks/allowed_html_tags', function( $allowed_html_tags ) {
// Define the additional tags to be added (e.g. 'form' & 'select')
$additional_tags = ['form', 'select'];
// Merge additional tags with the existing allowed tags
return array_merge( $allowed_html_tags, $additional_tags );
} );
暂无评论内容