WP_HTML_Open_Elements::contains( string $node_name ): bool

In this article

Reports if a node of a given name is in the stack of open elements.

Parameters

$node_namestringrequired
Name of node for which to check.

Return

bool Whether a node of the given name is in the stack of open elements.

Source

public function contains( string $node_name ): bool {
	foreach ( $this->walk_up() as $item ) {
		if ( $node_name === $item->node_name ) {
			return true;
		}
	}

	return false;
}

Changelog

VersionDescription
6.7.0Introduced.

User Contributed Notes

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