WP_Interactivity_API::config()
Gets and/or sets the configuration of the Interactivity API for a given store namespace.
If configuration for that store namespace exists, it merges the new provided configuration with the existing one.
Метод класса: WP_Interactivity_API{}
Хуков нет.
Возвращает
Массив
. The configuration for the specified store namespace. This will be the updated configuration if a $config argument was provided.
Использование
$WP_Interactivity_API = new WP_Interactivity_API(); $WP_Interactivity_API->config( $store_namespace, $config ): array;
- $store_namespace(строка) (обязательный)
- The unique store namespace identifier.
- $config(массив)
- The array that will be merged with the existing configuration for the specified store namespace.
По умолчанию: array()
Список изменений
С версии 6.5.0 | Введена. |
Код WP_Interactivity_API::config() WP Interactivity API::config WP 6.7.1
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 ]; }