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()
Return
array
The state for the specified store namespace. This will be the updated state if a $state argument was provided.
Signature, return type and hooks compared across 5 parsed releases.
7.1.0
Parameter $store_namespace retyped from string to string|null.verified against source
6.6.0
The namespace can be omitted when called inside derived state getters.from the docblock
6.5.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 6.9.7 tag, from src/wp-includes/interactivity-api/interactivity-api.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.