WP_HTML_Open_Elements::after_element_pop( WP_HTML_Token $item )

In this article

Updates internal flags after removing an element.

Description

Certain conditions (such as "has_p_in_button_scope") are maintained here as flags that are only modified when adding and removing elements. This allows the HTML Processor to quickly check for these conditions instead of iterating over the open stack elements upon each new tag it encounters. These flags, however, need to be maintained as items are added and removed from the stack.

Parameters

$itemWP_HTML_Tokenrequired
Element that was removed from the stack of open elements.

Source

 */
public function walk_up( $above_this_node = null ) {
	$has_found_node = null === $above_this_node;

	for ( $i = count( $this->stack ) - 1; $i >= 0; $i-- ) {
		$node = $this->stack[ $i ];

		if ( ! $has_found_node ) {
			$has_found_node = $node === $above_this_node;
			continue;
		}

		yield $node;
	}
}

Changelog

VersionDescription
6.4.0Introduced.

User Contributed Notes

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