wp_kses_split()
Searches for HTML tags, no matter how malformed.
It also matches stray > characters.
Хуков нет.
Возвращает
Строку
. Content with fixed HTML tags
Использование
wp_kses_split( $content, $allowed_html, $allowed_protocols );
- $content(строка) (обязательный)
- Content to filter.
- $allowed_html(array[]|строка) (обязательный)
- An array of allowed HTML elements and attributes, or a context name such as 'post'. See wp_kses_allowed_html() for the list of accepted context names.
- $allowed_protocols(string[]) (обязательный)
- Array of allowed URL protocols.
Заметки
- Global. Массив[]|Строка. $pass_allowed_html An array of allowed HTML elements and attributes, or a context name such as 'post'.
- Global. Строка[]. $pass_allowed_protocols Array of allowed URL protocols.
Список изменений
С версии 1.0.0 | Введена. |
Код wp_kses_split() wp kses split WP 6.4.1
function wp_kses_split( $content, $allowed_html, $allowed_protocols ) { global $pass_allowed_html, $pass_allowed_protocols; $pass_allowed_html = $allowed_html; $pass_allowed_protocols = $allowed_protocols; return preg_replace_callback( '%(<!--.*?(-->|$))|(<[^>]*(>|$)|>)%', '_wp_kses_split_callback', $content ); }