WP_HTML_Open_Elements::has_element_in_list_item_scope()publicWP 6.4.0

Returns whether a particular element is in list item scope.

Method of the class: WP_HTML_Open_Elements{}

No Hooks.

Return

true|false. Whether given element is in scope.

Usage

$WP_HTML_Open_Elements = new WP_HTML_Open_Elements();
$WP_HTML_Open_Elements->has_element_in_list_item_scope( $tag_name );
$tag_name(string) (required)
Name of tag to check.

Notes

Changelog

Since 6.4.0 Introduced.
Since 6.5.0 Implemented: no longer throws on every invocation.

WP_HTML_Open_Elements::has_element_in_list_item_scope() code WP 6.6.2

public function has_element_in_list_item_scope( $tag_name ) {
	return $this->has_element_in_specific_scope(
		$tag_name,
		array(
			// There are more elements that belong here which aren't currently supported.
			'OL',
			'UL',
		)
	);
}