wp_interactivity_as_dangerous_html
wp_interactivity_as_dangerous_html ( $html )
Parameters:- (string) html The HTML to mark as trusted. It is not sanitized.
Returns:- (WP_Interactivity_Dangerous_HTML) The token that carries the HTML.
Defined at: - Introduced in WordPress: 7.2.0
- Deprecated in WordPress: —
Description
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.