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