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

In this article

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

Description

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

Parameters

$store_namespacestringrequired
The unique store namespace identifier.
$configarrayoptional
The array that will be merged with the existing configuration for the specified store namespace.

Default:array()

Return

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

Source

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 ];
}

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.