# alch\_value\_{ $optionID }

Dynamic filter `alch_value_{ $optionID }` is used to filter the value for a given [field](https://docs.alchemy-options.com/v0.9/fields) before returning it from [`alch_get_option`](https://docs.alchemy-options.com/v0.9/functions/alch_get_option). It isn't applied to the `$default` parameter if the field has no value stored.

The `$optionID` should match one of the IDs in the [configuration object](https://github.com/AlchemyOptions/docs/tree/2c13c914d733b5a3046b1cbd4bd061c75f7de117/filters/Configuration.md).

## Example

Say you want to tweak the [URL field](https://docs.alchemy-options.com/v0.9/fields/url) with the ID of `my-url-field` to convert the `http` protocol to `https`.

```php
//somewhere in functions.php

function tweak_url_field( $value ) {
    // do not forget to pass it further
    return str_replace( "http://", "https://", $value );
}

add_filter( 'alch_value_my-url-field', 'tweak_url_field' );
```
