WP_HTML_Tag_Processor::get_token_type
Indicates the kind of matched token, if any.
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.
Метод класса: WP_HTML_Tag_Processor{}
Хуков нет.
Возвращает
Строку|null. What kind of token is matched, or null.
Использование
$WP_HTML_Tag_Processor = new WP_HTML_Tag_Processor(); $WP_HTML_Tag_Processor->get_token_type(): ?string;
Список изменений
| С версии 6.5.0 | Введена. |
Код WP_HTML_Tag_Processor::get_token_type() WP HTML Tag Processor::get token type WP 6.9.4
public function get_token_type(): ?string {
switch ( $this->parser_state ) {
case self::STATE_MATCHED_TAG:
return '#tag';
case self::STATE_DOCTYPE:
return '#doctype';
default:
return $this->get_token_name();
}
}