WP_HTML_Active_Formatting_Elements::contains_node( WP_HTML_Token $token ): bool

In this article

Reports if a specific node is in the stack of active formatting elements.

Parameters

$tokenWP_HTML_Tokenrequired
Look for this node in the stack.

Return

bool Whether the referenced node is in the stack of active formatting elements.

Source

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

	return false;
}

Changelog

VersionDescription
6.4.0Introduced.

User Contributed Notes

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