WP_HTML_Open_Elements::contains_node()
Reports if a specific node is in the stack of open elements.
Method of the class: WP_HTML_Open_Elements{}
No Hooks.
Return
true|false
. Whether the referenced node is in the stack of open elements.
Usage
$WP_HTML_Open_Elements = new WP_HTML_Open_Elements(); $WP_HTML_Open_Elements->contains_node( $token );
- $token(WP_HTML_Token) (required)
- Look for this node in the stack.
Changelog
Since 6.4.0 | Introduced. |
WP_HTML_Open_Elements::contains_node() WP HTML Open Elements::contains node code WP 6.6.2
public function contains_node( $token ) { foreach ( $this->walk_up() as $item ) { if ( $token->bookmark_name === $item->bookmark_name ) { return true; } } return false; }