WP_HTML_Token::__construct()
Constructor - creates a reference to a token in some external HTML string.
Method of the class: WP_HTML_Token{}
No Hooks.
Return
null
. Nothing (null).
Usage
$WP_HTML_Token = new WP_HTML_Token(); $WP_HTML_Token->__construct( ?string $bookmark_name, $node_name, $has_self_closing_flag, ?callable $on_destroy );
- ?string $bookmark_name (required)
- -
- $node_name(string) (required)
- Name of node token represents; if uppercase, an HTML element; if lowercase, a special value like "marker".
- $has_self_closing_flag(true|false) (required)
- Whether the source token contains the self-closing flag, regardless of whether it's valid.
- ?callable $on_destroy **
- -
Default: null
Changelog
Since 6.4.0 | Introduced. |
WP_HTML_Token::__construct() WP HTML Token:: construct code WP 6.7.1
public function __construct( ?string $bookmark_name, string $node_name, bool $has_self_closing_flag, ?callable $on_destroy = null ) { $this->bookmark_name = $bookmark_name; $this->namespace = 'html'; $this->node_name = $node_name; $this->has_self_closing_flag = $has_self_closing_flag; $this->on_destroy = $on_destroy; }