Pops nodes off of the stack of open elements until an HTML tag with the given name has been popped.
Description
See also
Parameters
$html_tag_namestringrequired- Name of tag that needs to be popped off of the stack of open elements.
Source
public function pop_until( string $html_tag_name ): bool {
foreach ( $this->walk_up() as $item ) {
$this->pop();
if ( 'html' !== $item->namespace ) {
continue;
}
if (
'(internal: H1 through H6 - do not use)' === $html_tag_name &&
in_array( $item->node_name, array( 'H1', 'H2', 'H3', 'H4', 'H5', 'H6' ), true )
) {
return true;
}
if ( $html_tag_name === $item->node_name ) {
return true;
}
}
return false;
}
Changelog
| Version | Description |
|---|---|
| 6.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.