wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_kses_split › WordPress Function

Da1.0.0
Deprecaton/a
wp_kses_split ( $content, $allowed_html, $allowed_protocols )
Parametri: (3)
  • (string) $content Content to filter.
    Richiesto:
  • (array[]|string) $allowed_html 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.
    Richiesto:
  • (string[]) $allowed_protocols Array of allowed URL protocols.
    Richiesto:
Ritorna:
  • (string) Content with fixed HTML tags
Definito a:
Codex:

Searches for HTML tags, no matter how malformed.

It also matches stray > characters.


Sorgenti

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 );
}