![图片[1]-Bricks 版本 1.10.2:如何通过过滤器添加额外的 HTML 标签(如 form 和 select)-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/09/20241108173952309-image.png)
releases1.10.2Bricks limits allowed HTML tags to WordPress core logicwp_kses_allowed_html( 'post' )The
This results in allowing the use of the following ready-made HTML tags:
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, hr, i, img, ins, kbd, label, legend, li, main, map, mark th, thead, title, tr, track, tt, u, ul, ol, var, video
For example.formBy default it is not allowed to set the "Custom labels" and will raise the following error in the builder:
![图片[2]-Bricks 版本 1.10.2:如何通过过滤器添加额外的 HTML 标签(如 form 和 select)-光子波动网 | WordPress教程、Elementor教程与故障修复](https://shop.361sale.com/wp-content/uploads/2024/09/bricks-1.10.3-filter-bricks-allowed-html-tags.png)
Using a new filter as shown in the following code snippet, theformtag is added to the list of allowed HTML tags and can be used without throwing any errors.
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 ); } );; // Merge additional tags with the existing allowed tags.
} ).
Link to this article:https://www.361sale.com/en/2905/The article is copyrighted and must be reproduced with attribution.























![表情[wozuimei]-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/themes/zibll/img/smilies/wozuimei.gif)
![表情[baoquan]-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/themes/zibll/img/smilies/baoquan.gif)

No comments