wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_interactivity_as_dangerous_html › WordPress Function

Seit7.2.0
Veraltetn/v
› wp_interactivity_as_dangerous_html ( $html )
Parameter:
  • (string) $html The HTML to mark as trusted. It is not sanitized.
    Erforderlich: Ja
Gibt zurück:
  • (WP_Interactivity_Dangerous_HTML) The token that carries the HTML.
Definiert in:
Codex:

Marks an HTML string as trusted, for `data-wp-html` to render as the content of an element.

The returned token is the only value data-wp-html renders in server directive processing. Warning: this function does not sanitize the HTML. Passing untrusted input, such as user-submitted content, creates a cross-site scripting (XSS) vulnerability. Sanitize it first, for example with wp_kses_post(), or build it only from trusted markup. A value read from context must never become a token, directly or after being copied into state. Context selects and state supplies: context is controlled by the client or by markup, so it may only select among tokens that server-side code created, and must never be the HTML a token is created from.


Quellcode

function wp_interactivity_as_dangerous_html( string $html ): WP_Interactivity_Dangerous_HTML {
	return new WP_Interactivity_Dangerous_HTML( $html );
}