Function __global->invert_value
Definitions
sources/config.php
- Very simple function to invert the meaning of an old hidden option. We often use this when we've promoted a hidden option into a new proper option but inverted the meaning in the process - we use this in the default value generation code, as an in-line aid to preserve existing hidden option settings.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $old | ID_TEXT | No | No | required parameter | 0 1 | N/A | The old value |
Returns
- The inverted value
- Type: ID_TEXT
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Very simple function to invert the meaning of an old hidden option. We often use this when we've promoted a hidden option into a new proper option but inverted the meaning in the process - we use this in the default value generation code, as an in-line aid to preserve existing hidden option settings.
*
* @param ID_TEXT $old The old value
* @set 0 1
* @return ID_TEXT The inverted value
*/
function invert_value(string $old) : string
* Very simple function to invert the meaning of an old hidden option. We often use this when we've promoted a hidden option into a new proper option but inverted the meaning in the process - we use this in the default value generation code, as an in-line aid to preserve existing hidden option settings.
*
* @param ID_TEXT $old The old value
* @set 0 1
* @return ID_TEXT The inverted value
*/
function invert_value(string $old) : string

