![Image[1]-Bricks version 1.10.2: How to add additional HTML tags (such as form and select) via filters - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/20241108173952309-image.png)
releases1.10.2
Bricks 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.form
By default it is not allowed to set the "Custom labels" and will raise the following error in the builder:
![Image [2]-Bricks version 1.10.2: How to add additional HTML tags (like form and select) via filters - Photon Flux | Professional WordPress repair service, worldwide, fast response](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, theform
tag 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.
No comments