wp_interactivity_state()
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.
The namespace can be omitted inside derived state getters, using the namespace where the getter is defined.
Хуков нет.
Возвращает
Массив
. The state for the specified store namespace. This will be the updated state if a $state argument was provided.
Использование
wp_interactivity_state( ?string $store_namespace, $state ): array;
- ?string $store_namespace **
- -
По умолчанию: null - $state(массив)
- The array that will be merged with the existing state for the specified store namespace.
По умолчанию: array()
Список изменений
С версии 6.5.0 | Введена. |
С версии 6.6.0 | The namespace can be omitted when called inside derived state getters. |
Код wp_interactivity_state() wp interactivity state WP 6.7.1
function wp_interactivity_state( ?string $store_namespace = null, array $state = array() ): array { return wp_interactivity()->state( $store_namespace, $state ); }