WP_HTML_Tag_Processor::is_tag_closer(): bool

In this article

Indicates if the current tag token is a tag closer.

Description

Example:

$p = new WP_HTML_Tag_Processor( '<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;

Return

bool Whether the current tag is a tag closer.

Source

* The `class` attribute is special though because of the exposed helpers `add_class`
* and `remove_class`. These form a builder for the `class` attribute, so an additional
* check for enqueued class changes is required in addition to the check for any enqueued
* attribute values. If any exist, those enqueued class changes must first be flushed out
* into an attribute value update.
*/

Changelog

VersionDescription
6.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.