Steps through the stack of open elements, starting with the bottom element (added last) and walking upwards to the one added first.
Description
This generator function is designed to be used inside a "foreach" loop. Example: $html = '<em><strong><a>We are here';
foreach ( $stack->walk_up() as $node ) {
echo "{$node->node_name} -> ";
}
> A -> STRONG -> EM -> To start with the first added element and walk towards the bottom, see WP_HTML_Open_Elements::walk_down().
Parameters
$above_this_nodeWP_HTML_Token|nulloptional
Start traversing above this node, if provided and if the node exists.Default: null
Signature, return type and hooks compared across 5 parsed releases.
6.5.0
Accepts $above_this_node to start traversal above a given node, if it exists.from the docblock
6.4.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 6.8.8 tag, from src/wp-includes/html-api/class-wp-html-open-elements.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.