Validates field values for an array of fields.
Description
See also
Parameters
- $values
-
(array) (Required) Array of values.
- $option
-
(string) (Required) Option name.
- $fields
-
(array) (Required) Array of field instances.
Return
(array) Array of validated values.
Source
File: src/db-objects/forms/form-settings-page.php
protected function validate_values( $values, $option, $fields ) { $old_values = get_option( $option, array() ); $new_values = parent::validate_values( $values, $option, $fields ); if ( ! empty( $old_values['slug'] ) && ! empty( $new_values['slug'] ) && $new_values['slug'] !== $old_values['slug'] ) { // Deleting this option ensures that rewrite rules are flushed. $this->form_manager->options()->delete( 'rewrite_rules' ); } return $new_values; }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |