WP_HTML_Processor::get_adjusted_current_node
Returns the adjusted current node.
The adjusted current node is the context element if the parser was created as > part of the HTML fragment parsing algorithm and the stack of open elements > has only one element in it (fragment case); otherwise, the adjusted current > node is the current node.
Метод класса: WP_HTML_Processor{}
Хуков нет.
Возвращает
WP_HTML_Token|null. The adjusted current node.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_adjusted_current_node(): ?WP_HTML_Token;
Заметки
| Смотрите: https://html.spec.whatwg.org/#adjusted-current-node |
Список изменений
| С версии 6.7.0 | Введена. |
Код WP_HTML_Processor::get_adjusted_current_node() WP HTML Processor::get adjusted current node WP 7.1
private function get_adjusted_current_node(): ?WP_HTML_Token {
if ( isset( $this->context_node ) && 1 === $this->state->stack_of_open_elements->count() ) {
return $this->context_node;
}
return $this->state->stack_of_open_elements->current_node();
}