Bricks version 1.10.2: How to add additional HTML tags (like form and select) via filters

图片[1]-Bricks 版本 1.10.2:如何通过过滤器添加额外的 HTML 标签(如 form 和 select)-光子波动网 | WordPress教程、Elementor教程与故障修复

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教程与故障修复

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.
} ).

Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
客服微信
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: [email protected]
Working hours: Monday to Friday, 9:30-18:30, holidays off
© Reprint statement
Author: xieyingsong
THE END
If you like it, support it.
kudos0 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments