Indicates the kind of matched token, if any.
Description
This differs from get_token_name() in that it always returns a static string indicating the type, whereas get_token_name() may return values derived from the token itself, such as a tag name or processing instruction tag.
Possible values:
#tagwhen matched on a tag.#textwhen matched on a text node.#cdata-sectionwhen matched on a CDATA node.#commentwhen matched on a comment.#doctypewhen matched on a DOCTYPE declaration.#presumptuous-tagwhen matched on an empty tag closer.#funky-commentwhen matched on a funky comment.
Source
*
* This internal function performs the 'before head' insertion mode
* logic for the generalized WP_HTML_Processor::step() function.
*
* @since 6.7.0 Stub implementation.
*
* @throws WP_HTML_Unsupported_Exception When encountering unsupported HTML input.
*
* @see https://html.spec.whatwg.org/#the-before-head-insertion-mode
* @see WP_HTML_Processor::step
*
* @return bool Whether an element was found.
*/
private function step_before_head(): bool {
$token_name = $this->get_token_name();
$token_type = $this->get_token_type();
$is_closer = parent::is_tag_closer();
$op_sigil = '#tag' === $token_type ? ( $is_closer ? '-' : '+' ) : '';
$op = "{$op_sigil}{$token_name}";
switch ( $op ) {
/*
* > A character token that is one of U+0009 CHARACTER TABULATION,
Changelog
| Version | Description |
|---|---|
| 6.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.