WP_HTML_Open_Elements::has_element_in_scope()publicWP 6.4.0

Returns whether a particular element is in scope.

Метод класса: WP_HTML_Open_Elements{}

Хуков нет.

Возвращает

true|false. Whether given element is in scope.

Использование

$WP_HTML_Open_Elements = new WP_HTML_Open_Elements();
$WP_HTML_Open_Elements->has_element_in_scope( $tag_name );
$tag_name(строка) (обязательный)
Name of tag to check.

Заметки

Список изменений

С версии 6.4.0 Введена.

Код WP_HTML_Open_Elements::has_element_in_scope() WP 6.6.2

public function has_element_in_scope( $tag_name ) {
	return $this->has_element_in_specific_scope(
		$tag_name,
		array(

			/*
			 * Because it's not currently possible to encounter
			 * one of the termination elements, they don't need
			 * to be listed here. If they were, they would be
			 * unreachable and only waste CPU cycles while
			 * scanning through HTML.
			 */
		)
	);
}