Title: wp_interactivity_get_element
Published: February 24, 2026

---

# wp_interactivity_get_element(): array{attributes:

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_interactivity_get_element/?output_format=md#description)
 * [Return](https://developer.wordpress.org/reference/functions/wp_interactivity_get_element/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_interactivity_get_element/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_interactivity_get_element/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_interactivity_get_element/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_interactivity_get_element/?output_format=md#wp--skip-link--target)

Returns an array representation of the current element being processed.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/wp_interactivity_get_element/?output_format=md#description)󠁿

The function should be used only during directive processing.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_interactivity_get_element/?output_format=md#return)󠁿

 array{attributes: array<string, `string|bool`>}|null Current element.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_interactivity_get_element/?output_format=md#source)󠁿

    ```php
    function wp_interactivity_get_element(): ?array {
    	return wp_interactivity()->get_element();
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/interactivity-api/interactivity-api.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/interactivity-api/interactivity-api.php#L138)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/interactivity-api/interactivity-api.php#L138-L140)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_interactivity_get_element/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_interactivity()](https://developer.wordpress.org/reference/functions/wp_interactivity/)`wp-includes/interactivity-api/interactivity-api.php` |

Retrieves the main [WP_Interactivity_API](https://developer.wordpress.org/reference/classes/wp_interactivity_api/) instance.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_interactivity_get_element/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.7.0](https://developer.wordpress.org/reference/since/6.7.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_interactivity_get_element%2F)
before being able to contribute a note or feedback.