WP_HTML_Processor::get_token_name
Returns the node name represented by the token.
This matches the DOM API value nodeName. Some values are static, such as #text for a text node, while others are dynamically generated from the token itself.
Dynamic names:
- Uppercase tag name for tag matches.
htmlfor DOCTYPE declarations.
Note that if the Tag Processor is not matched on a token then this function will return null, either because it hasn't yet found a token or because it reached the end of the document without matching a token.
Метод класса: WP_HTML_Processor{}
Хуков нет.
Возвращает
Строку|null. Name of the matched token.
Использование
$WP_HTML_Processor = new WP_HTML_Processor(); $WP_HTML_Processor->get_token_name(): ?string;
Список изменений
| С версии 6.6.0 | Введена. |
| С версии 6.6.0 | Subclassed for the HTML Processor. |
Код WP_HTML_Processor::get_token_name() WP HTML Processor::get token name WP 7.0
public function get_token_name(): ?string {
return $this->is_virtual()
? $this->current_element->token->node_name
: parent::get_token_name();
}