Definition at line 18 of file SettingsValidator.php.
◆ __construct()
◆ add_custom_validation_rules()
add_custom_validation_rules |
( |
| ) |
|
|
private |
Adds custom validation rules (these match custom Yup rules added in the UI).
- Since
- 1.0.0
- See also
UI/src/lib/validation.js
Definition at line 63 of file SettingsValidator.php.
References $value.
◆ run_validator()
run_validator |
( |
|
$rule, |
|
|
|
$value |
|
) |
| |
|
private |
◆ validate()
validate |
( |
|
$plugin, |
|
|
array |
$original_settings, |
|
|
array |
$settings_to_validate |
|
) |
| |
Validates settings.
- Since
- 1.0.0
- Parameters
-
string | $plugin | Plugin ID. |
array | $original_settings | Flattened settings object (i.e., not split by sections) as defined by the plugin (see gk/foundation/settings/data/plugins filter). |
array | $settings_to_validate | Setting/value pair to validate. |
- Exceptions
-
- Returns
- bool
- Runs Actions:
gk/foundation/settings/{plugin}/validation/{setting_id}
Runs when validation rules are not specified and before the setting is marked as validated.
- Since
- 1.0.0
- Parameters
-
array | $setting | Original setting. |
string | $value_to_validate | Value to validate. |
Definition at line 142 of file SettingsValidator.php.
◆ $file_loader
◆ $filesystem
◆ $translator
◆ $validator_factory
The documentation for this class was generated from the following file: