Gets and/or sets the initial state of an Interactivity API store for a given namespace.
Description
If state for that store namespace already exists, it merges the new provided state with the existing one.
The namespace can be omitted inside derived state getters, using the namespace where the getter is defined.
Parameters
$store_namespacestringoptional- The unique store namespace identifier.
Default:
null $statearrayoptional- The array that will be merged with the existing state for the specified store namespace.
Default:
array()
Source
function wp_interactivity_state( ?string $store_namespace = null, array $state = array() ): array {
return wp_interactivity()->state( $store_namespace, $state );
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.