WP_HTML_Processor::generate_implied_end_tags
Closes elements that have implied end tags.
Метод класса: WP_HTML_Processor{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->generate_implied_end_tags( ?string $except_for_this_element ): void;
- ?string $except_for_this_element
- .
По умолчанию: null
Заметки
Список изменений
| С версии 6.4.0 | Введена. |
| С версии 6.7.0 | Full spec support. |
Код WP_HTML_Processor::generate_implied_end_tags() WP HTML Processor::generate implied end tags WP 6.8.3
private function generate_implied_end_tags( ?string $except_for_this_element = null ): void {
$elements_with_implied_end_tags = array(
'DD',
'DT',
'LI',
'OPTGROUP',
'OPTION',
'P',
'RB',
'RP',
'RT',
'RTC',
);
$no_exclusions = ! isset( $except_for_this_element );
while (
( $no_exclusions || ! $this->state->stack_of_open_elements->current_node_is( $except_for_this_element ) ) &&
in_array( $this->state->stack_of_open_elements->current_node()->node_name, $elements_with_implied_end_tags, true )
) {
$this->state->stack_of_open_elements->pop();
}
}