WP_Interactivity_API::get_element()publicWP 6.7.0

Returns an array representation of the current element being processed.

The returned array contains a copy of the element attributes.

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

Хуков нет.

Возвращает

Массив{attributes:. array<string, string|bool>}|null Current element.

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

$WP_Interactivity_API = new WP_Interactivity_API();
$WP_Interactivity_API->get_element(): ?array;

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

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

Код WP_Interactivity_API::get_element() WP 6.7.1

public function get_element(): ?array {
	if ( null === $this->current_element ) {
		_doing_it_wrong(
			__METHOD__,
			__( 'The element can only be read during directive processing.' ),
			'6.7.0'
		);
	}

	return $this->current_element;
}