WP_HTML_Open_Elements::current_node()publicWP 6.4.0

Returns the node at the end of the stack of open elements, if one exists. If the stack is empty, returns null.

Method of the class: WP_HTML_Open_Elements{}

No Hooks.

Return

WP_HTML_Token|null. Last node in the stack of open elements, if one exists, otherwise null.

Usage

$WP_HTML_Open_Elements = new WP_HTML_Open_Elements();
$WP_HTML_Open_Elements->current_node(): ?WP_HTML_Token;

Changelog

Since 6.4.0 Introduced.

WP_HTML_Open_Elements::current_node() code WP 6.7.1

public function current_node(): ?WP_HTML_Token {
	$current_node = end( $this->stack );

	return $current_node ? $current_node : null;
}