<?php
function wp_kses_split( $string, $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', $string );
}
function _wp_kses_split_callback( $match ) {
global $pass_allowed_html, $pass_allowed_protocols;
return wp_kses_split2( $match[1], $pass_allowed_html, $pass_allowed_protocols );
}
function wp_kses_split2($string, $allowed_html, $allowed_protocols) {
wp_kses_split('', array(), array()); // this overrides the globals.
print_r( array( $allowed_html, $allowed_protocols ) );
}
wp_kses_split("<a style='color: red;'>I link this</a>", array('a'=>array( 'style' => array() )), array('http') );
preferences:
64.73 ms | 405 KiB | 6 Q