## Set transformations
If you want to modify the settings object based on the current content, you can do that by registering a `
SettingsTransform` callback for a given property or plugin. You can also remove registered transformations if you know the key. The current settings instance, content, and property name will be passed to the callback. The content item can be NULL.
### Add a setting transformation
### Add a setting transformation for a plugin
If you are a plugin developer and need to run custom initialization code based on the current content item, you should register the transformation callback with your plugin.
If your code throws an exception, the exception is handled, logged, and passed to the client and an error message is displayed to the user.
### Order of execution
If there are transformations registered both for plugins and on the setting, the plugin transformation runs first and then any transformation on the setting. This lets the site developer modify the settings after the plugin developer completes modifications.
## Inherit settings from ancestors
To inherit settings from an ancestor, you need to set the `
InheritSettingsFromAncestor` property to true. It is set to false by default.
This is a global setting that is applied for all types that are configured.
InheritSettingsFromAncestor` is true, Optimizely tries to resolve the setting for a given property starting with the leaf; after that, it traverses upwards in the inheritance hierarchy to try to find the closest ancestor that has a setting for that property. If it cannot be found in the class hierarchy, `
Default()` is used.
This property should not be changed by any plugins. It should only be used when configuring the site.