WP_HTML_Tag_Processor::next_token
Finds the next token in the HTML document.
An HTML document can be viewed as a stream of tokens, where tokens are things like HTML tags, HTML comments, text nodes, etc. This method finds the next token in the HTML document and returns whether it found one.
If it starts parsing a token and reaches the end of the document then it will seek to the start of the last token and pause, returning false to indicate that it failed to find a complete token.
Possible token types, based on the HTML specification:
- an HTML tag, whether opening, closing, or void.
- a text node - the plaintext inside tags.
- an HTML comment.
- a DOCTYPE declaration.
- a processing instruction, e.g.
<?xml version="1.0" ?>.
The Tag Processor currently only supports the tag token.
Метод класса: WP_HTML_Tag_Processor{}
Хуков нет.
Возвращает
true|false. Whether a token was parsed.
Использование
$WP_HTML_Tag_Processor = new WP_HTML_Tag_Processor(); $WP_HTML_Tag_Processor->next_token(): bool;
Список изменений
| С версии 6.5.0 | Введена. |
| С версии 6.7.0 | Recognizes CDATA sections within foreign content. |
Код WP_HTML_Tag_Processor::next_token() WP HTML Tag Processor::next token WP 7.0
public function next_token(): bool {
return $this->base_class_next_token();
}