1 config.api.php hook_config_create(Config $staging_config)

Respond to configuration creation.


Config $staging_config: The configuration object for the settings about to be saved. This object is always passed by reference and may be modified to adjust the settings that are saved.

Related topics


core/modules/config/config.api.php, line 168
Documentation for hooks provided by Config module.


function hook_config_create(Config $staging_config) {
  if (strpos($staging_config->getName(), 'image.style') === 0) {
    // Set a value before the config is saved.
    $staging_config->set('some_key', 'default');