WP_HTML_Processor::is_tag_closer()
Indicates if the current tag token is a tag closer.
Example:
$p = WP_HTML_Processor::create_fragment( '<div></div>' ); $p->next_tag( array( 'tag_name' => 'div', 'tag_closers' => 'visit' ) ); $p->is_tag_closer() === false;
$p->next_tag( array( 'tag_name' => 'div', 'tag_closers' => 'visit' ) ); $p->is_tag_closer() === true;
Метод класса: WP_HTML_Processor{}
Хуков нет.
Возвращает
true|false
. Whether the current tag is a tag closer.
Использование
$WP_HTML_Processor = new WP_HTML_Processor(); $WP_HTML_Processor->is_tag_closer(): bool;
Список изменений
С версии 6.6.0 | Введена. |
С версии 6.6.0 | Subclassed for HTML Processor. |
Код WP_HTML_Processor::is_tag_closer() WP HTML Processor::is tag closer WP 6.8.1
public function is_tag_closer(): bool { return $this->is_virtual() ? ( WP_HTML_Stack_Event::POP === $this->current_element->operation && '#tag' === $this->get_token_type() ) : parent::is_tag_closer(); }