[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/interactivity-api/ -> class-wp-interactivity-dangerous-html.php (summary)

Interactivity API: WP_Interactivity_Dangerous_HTML class.

File Size: 111 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 5 functions

  __construct()
  get_html()
  __wakeup()
  jsonSerialize()
  getIterator()

Functions
Functions that are not part of a class:

__construct( string $html )   X-Ref
Constructor.

param: string $html The HTML to mark as trusted. It is not sanitized.

get_html( $value )   X-Ref
Gets the trusted HTML of a value.

param: mixed $value Any value.
return: string|null The HTML of the token if the value is a token whose constructor

__wakeup()   X-Ref
Makes a token restored by unserialization inert.

Clears the HTML, so the token never renders, and reports the unserialization
instead of throwing, so a page that cached a token keeps working.


jsonSerialize()   X-Ref
Gets the value that JSON encoding prints in place of the token.

It is the same for every token and holds none of its HTML.

return: array<string, bool> The marker: a single `wpServerHtml` entry set to `true`,

getIterator()   X-Ref
Gets the iterator that `foreach` and the fallback of `wp_json_encode()` read.

It yields the same single entry as {@see WP_Interactivity_Dangerous_HTML::jsonSerialize()}
and none of the token's HTML.

return: Traversable<string, bool> An iterator yielding `wpServerHtml` => `true`, once.



Generated : Fri Nov 6 08:20:37 2026 Cross-referenced by PHPXref