wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi
filter_block_content › WordPress Function
Da5.3.1
Deprecaton/a
› filter_block_content ( $text, $allowed_html = 'post', $allowed_protocols = array() )
Parametri: (3) |
|
Ritorna: |
|
Definito a: |
|
Codex: |
Filters and sanitizes block content to remove non-allowable HTML from parsed block attribute values.
Sorgenti
function filter_block_content( $text, $allowed_html = 'post', $allowed_protocols = array() ) { $result = ''; if ( str_contains( $text, '<!--' ) && str_contains( $text, '--->' ) ) { $text = preg_replace_callback( '%<!--(.*?)--->%', '_filter_block_content_callback', $text ); } $blocks = parse_blocks( $text ); foreach ( $blocks as $block ) { $block = filter_block_kses( $block, $allowed_html, $allowed_protocols ); $result .= serialize_block( $block ); } return $result; }