WP_Interactivity_API::get_element
Returns an array representation of the current element being processed.
The returned array contains a copy of the element attributes.
Method of the class: WP_Interactivity_API{}
No Hooks.
Returns
Array{attributes:. array<string, string|bool>}|null Current element.
Usage
$WP_Interactivity_API = new WP_Interactivity_API(); $WP_Interactivity_API->get_element(): ?array;
Changelog
| Since 6.7.0 | Introduced. |
WP_Interactivity_API::get_element() WP Interactivity API::get element code WP 6.9.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;
}