WP_HTML_Open_Elements::has_element_in_specific_scope( string $tag_name, string[] $termination_list ): bool

Returns whether an element is in a specific scope.

Description

HTML Support

This function skips checking for the termination list because there are no supported elements which appear in the termination list.

See also

Parameters

$tag_namestringrequired
Name of tag check.
$termination_liststring[]required
List of elements that terminate the search.

Return

bool Whether the element was found in a specific scope.

Source

	foreach ( $this->walk_up() as $item ) {
		if ( $token->bookmark_name === $item->bookmark_name ) {
			return true;
		}
	}

	return false;
}

/**
 * Returns how many nodes are currently in the stack of open elements.
 *
 * @since 6.4.0
 *
 * @return int How many node are in the stack of open elements.
 */
public function count() {
	return count( $this->stack );
}

/**
 * Returns the node at the end of the stack of open elements,
 * if one exists. If the stack is empty, returns null.
 *
 * @since 6.4.0

Changelog

VersionDescription
6.4.0Introduced.

User Contributed Notes

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