Title: WP_Interactivity_API::config
Published: April 3, 2024
Last modified: February 24, 2026

---

# WP_Interactivity_API::config( string $store_namespace, array $config = array() ): array

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_interactivity_api/config/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/classes/wp_interactivity_api/config/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_interactivity_api/config/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_interactivity_api/config/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_interactivity_api/config/?output_format=md#changelog)

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

Gets and/or sets the configuration of the Interactivity API for a given store namespace.

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

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

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_interactivity_api/config/?output_format=md#parameters)󠁿

 `$store_namespace`stringrequired

The unique store namespace identifier.

`$config`arrayoptional

The array that will be merged with the existing configuration for the specified 
store namespace.

Default:`array()`

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

 array The configuration for the specified store namespace. This will be the updated
configuration if a $config argument was provided.

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

    ```php
    public function config( string $store_namespace, array $config = array() ): array {
    	if ( ! isset( $this->config_data[ $store_namespace ] ) ) {
    		$this->config_data[ $store_namespace ] = array();
    	}
    	if ( is_array( $config ) ) {
    		$this->config_data[ $store_namespace ] = array_replace_recursive(
    			$this->config_data[ $store_namespace ],
    			$config
    		);
    	}
    	return $this->config_data[ $store_namespace ];
    }
    ```

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

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

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

## User Contributed Notes

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