wp_interactivity_state()WP 6.5.0

Gets and/or sets the initial state of an Interactivity API store for a given namespace.

If state for that store namespace already exists, it merges the new provided state with the existing one.

No Hooks.


Array. The state for the specified store namespace. This will be the updated state if a $state argument was provided.


wp_interactivity_state( $store_namespace, $state ): array;
$store_namespace(string) (required)
The unique store namespace identifier.
The array that will be merged with the existing state for the specified store namespace.
Default: array()


Since 6.5.0 Introduced.

wp_interactivity_state() code WP 6.5.4

function wp_interactivity_state( string $store_namespace, array $state = array() ): array {
	return wp_interactivity()->state( $store_namespace, $state );