MENÜ

Bricks Version 1.10.2: Hinzufügen von zusätzlichen HTML-Tags (wie form und select) über Filter

Bricks Version 1.10.2: Hinzufügen von zusätzlichen HTML-Tags (wie form und select) über Filter

版本1.10.2Bricks 将允许的 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默认情况下不允许在“块”元素上设置“自定义标签”,并且会在构建器中引发以下错误:

Bricks Version 1.10.2: Hinzufügen von zusätzlichen HTML-Tags (wie form und select) über Filter

使用如下面的代码片段所示的新过滤器,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 );
} );

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Kontakt

Kontakt

020-2206-9892

QQ在线咨询:1025174874

E-Mail: info@361sale.com

Arbeitszeiten: Montag bis Freitag, 9:30-18:30 Uhr, Feiertage frei

AKTIE
TOP
Bitte wenden Sie sich an den Kundendienst, um das Plug-in nach dem Kauf für Sie zu aktivieren.