WP_Interactivity_API_Directives_Processor::skip_to_tag_closer(): bool

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Skips processing the content between tags.

Description

It positions the cursor in the closer tag of the foreign element, if it exists.

This function is intended to skip processing SVG and MathML inner content instead of bailing out the whole processing.

Return

bool Whether the foreign content was successfully skipped.

Source

public function skip_to_tag_closer(): bool {
	$depth    = 1;
	$tag_name = $this->get_tag();
	while ( $depth > 0 && $this->next_tag(
		array(
			'tag_name'    => $tag_name,
			'tag_closers' => 'visit',
		)
	) ) {
		if ( $this->has_self_closing_flag() ) {
			continue;
		}
		$depth += $this->is_tag_closer() ? -1 : 1;
	}

	return 0 === $depth;
}

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

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